Walter Meester
HoogkarspelNetherlands
General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Joerg,
Add a DBSetProp('Test', 'View', 'Tables', 'YourDB!File13')
HTH,
Walter,
>Hi there,
>
>i have an error here that i never saw before. Here is some code:
>
>==========================================
>open data data\sqlgt
>Create SQL View test Remote ;
> Connection SQLGT Share ;
> As Select f13id, f13fmid, tabName ;
> From File13, Tabula ;
> Where f13UnitID = tabID
>=SetProperties("test")
>Close All
>Open Data data\sqlgt
>use test
>brow
>
>Procedure SetProperties
>LParameter cViewName
>Use (cViewName) NoData
>DBSetProp(cViewName +"." +Field(1), "Field", "Keyfield", .T.)
>DBSetProp(cViewName, "View", "BatchUpdateCount", 100)
>DBSetProp(cViewName, "View", "CompareMemo", .T.)
>DBSetProp(cViewName, "View", "FetchAsNeeded", .F.)
>DBSetProp(cViewName, "View", "FetchMemo", .T.)
>DBSetProp(cViewName, "View", "FetchSize", -1)
>DBSetProp(cViewName, "View", "MaxRecords", -1)
>DBSetProp(cViewName, "View", "Prepared", .T.)
>DBSetProp(cViewName, "View", "SendUpdates", .T.)
>DBSetProp(cViewName, "View", "ShareConnection", .T.)
>DBSetProp(cViewName, "View", "UpdateType", 1)
>DBSetProp(cViewName, "View", "WhereType", 3)
>DBSetProp(cViewName +"." +Field(1), "Field", "Updatable", .T.)
>DBSetProp(cViewName +"." +Field(2), "Field", "Updatable", .T.)
>DBSetProp(cViewName +"." +Field(3), "Field", "Updatable", .F.)
>=========================================
>
>When i run this, add a new entry in the browse window, add some valid data to f13id (PK) and f13fmid (FK) and shoot TableUpdate(.T., .T.), he shoots back with: Cannot insert an empty row from a view into its base table(s) (Error 1547)
>
>I guess it has to do with the Tabula that i'm joining, but i could bet that there is no key field defined for Tabula nor is TabName updatable.
>The same error occurs if tabName is updatable or if tabid (PK) is taken into the Fields list.
>
>How can i create this view so that i can write back all changes to File13, but nothing to Tabula?
>
>Best Regards
>Joerg Karpa
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only