Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating .Null. values in a View
Message
From
16/04/2005 07:17:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/04/2005 17:49:41
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01005366
Message ID:
01005434
Views:
20
>Hey,
>I would like a view to insert a key value and update the views
>modified field (which is .null.).
>
>The view I have is composed of 2 free tables.
>
> FROM Table_A LEFT OUTER JOIN Table_B ;
> ON Table_A.KeyValue = Table_B.KeyValue
>
>The view has "Send SQL Updates" checked, key fields marked for Table_A and Table _B, "SQL UPDATE" is checked as well as "Key and modified fields".
>
>Some of the records retrieve .Null. values for table_b,
>since there are no matching records in table_b to table_a.
>If I edit the .Null. value in the view and move the record
>pointer I get an error "Update Conflict".
>Is is possible to get the View to update by inserting
>the keyvalue into table_b and then updating the modified field?
>
>I searched the thread through and through.. but can't find a solution...
>thanks,
>Daniel

Daniel,
There is a solution but not worth the trouble IMHO. The solution is actually along the lines of your question - "Is is possible to get the View to update by inserting the keyvalue into table_b and then updating the modified field?". Views by default are buffered at row level and when you try to move the pointer off the record it tries to update. Record is not a new record hence it tries to find a matching ID but can't match .null. to anything. If you instead use table level buffering:
cursorsetprop("Buffering",5,"myView")
you take control of tableupdate/revert.

My suggestion never use views, though VFP allows it, to update multiple tables.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform