Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot insert an empty row from a view into its base tab
Message
From
27/09/2000 02:20:47
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00421222
Message ID:
00421322
Views:
18
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
Map
View

Click here to load this message in the networking platform