Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating .Null. values in a View
Message
De
16/04/2005 07:17:27
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
15/04/2005 17:49:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01005366
Message ID:
01005434
Vues:
19
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform