Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with TABLEUPDATE when saving an existing record
Message
 
À
15/04/2014 16:35:55
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
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 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01598673
Message ID:
01598676
Vues:
28
>>I have a work order form that allows users to enter work order info and to populate two child tables (via grids) in order to specify labor and materials. The form uses local views. The child labor and materials views have optimistic table bufffering set (5). The "parent" single record work order local view has optimistic row buffering set (3).
>>
>>If i add a NEW work order and enter in child labor and material records, i can save the work order and its child information. However, when i try to EDIT an EXISTING record, by changing something in the labor or material grid, the TABLEUPDATE(.t., .t., "v_worklab",laError) fails with the error message of "syntax error". This is nothing else stored in the error array.
>>
>>Any ideas?
>
>to the view that fails.(if more then one fails, the shortest :) )
>
>Is it possible to show the VIEW definition (if SELECT * a DISP STRU, please) and the definition of the DBGETPROPS ?
>DBGETPROP(lcView","VIEW","TABLES")
>DBGETPROP(lcView,"VIEW","SENDUPDATES")
>DBGETPROP(lcView,"VIEW","WHERETYPE")
>DBGETPROP(lcView,"VIEW","UPDATETYPE")
>for all fields in view:
>DBGETPROP(lcView+".Field_X","FIELD","UPDATENAME")
>DBGETPROP(lcView+".Field_X","FIELD","UPDATABLE")
>DBGETPROP(lcView+".Field_X","FIELD","KEYFIELD")
>
>It is also a way to run through your table using GETNEXTMODIFIED and tableupdate record by record for debugging. Maybe you se somthing With the view and the target to update open one can see the changes and the records involved.
>
>Lutz

Here is the view def:

UPDATED: my first post of the view def had the PK field set to NOT updateable. It IS updateable. That was a hold over from trying to reselect all the fields to update in the def.
SELECT Worklab.labpk, Worklab.wofk, Worklab.desc, Worklab.hours,;
  Worklab.rate, Worklab.totlab;
 FROM ;
     rp!worklab;
 WHERE  Worklab.wofk = ( ?lnWOFK );
 ORDER BY Worklab.desc

DBSetProp(ThisView,"View","SendUpdates",.T.)
DBSetProp(ThisView,"View","BatchUpdateCount",1)
DBSetProp(ThisView,"View","CompareMemo",.T.)
DBSetProp(ThisView,"View","FetchAsNeeded",.F.)
DBSetProp(ThisView,"View","FetchMemo",.T.)
DBSetProp(ThisView,"View","FetchSize",100)
DBSetProp(ThisView,"View","MaxRecords",-1)
DBSetProp(ThisView,"View","Prepared",.F.)
DBSetProp(ThisView,"View","UpdateType",1)
DBSetProp(ThisView,"View","UseMemoSize",255)
DBSetProp(ThisView,"View","Tables","rp!worklab")
DBSetProp(ThisView,"View","WhereType",3)

DBSetProp(ThisView+".labpk","Field","DataType","N(10)")
DBSetProp(ThisView+".labpk","Field","UpdateName","rp!worklab.labpk")
DBSetProp(ThisView+".labpk","Field","KeyField",.T.)
DBSetProp(ThisView+".labpk","Field","Updatable",.T.)

DBSetProp(ThisView+".wofk","Field","DataType","N(10)")
DBSetProp(ThisView+".wofk","Field","UpdateName","rp!worklab.wofk")
DBSetProp(ThisView+".wofk","Field","KeyField",.F.)
DBSetProp(ThisView+".wofk","Field","Updatable",.T.)

DBSetProp(ThisView+".desc","Field","DataType","C(30)")
DBSetProp(ThisView+".desc","Field","UpdateName","rp!worklab.desc")
DBSetProp(ThisView+".desc","Field","KeyField",.F.)
DBSetProp(ThisView+".desc","Field","Updatable",.T.)

DBSetProp(ThisView+".hours","Field","DataType","N(6,1)")
DBSetProp(ThisView+".hours","Field","UpdateName","rp!worklab.hours")
DBSetProp(ThisView+".hours","Field","KeyField",.F.)
DBSetProp(ThisView+".hours","Field","Updatable",.T.)

DBSetProp(ThisView+".rate","Field","DataType","N(8,2)")
DBSetProp(ThisView+".rate","Field","UpdateName","rp!worklab.rate")
DBSetProp(ThisView+".rate","Field","KeyField",.F.)
DBSetProp(ThisView+".rate","Field","Updatable",.T.)

DBSetProp(ThisView+".totlab","Field","DataType","N(12,2)")
DBSetProp(ThisView+".totlab","Field","UpdateName","rp!worklab.totlab")
DBSetProp(ThisView+".totlab","Field","KeyField",.F.)
DBSetProp(ThisView+".totlab","Field","Updatable",.T.)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform