Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TABLEUPDATE updates ALL rows with the same value.
Message
De
05/04/2005 19:03:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
05/04/2005 18:13:54
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
OS:
Windows XP
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
01001725
Message ID:
01001739
Vues:
13
This message has been marked as the solution to the initial question of the thread.
Make sure your primary key is defined correctly in the view. The field or fields you specify in the PK must uniquely identify a record.

>User will typically change a particular field with different values for different rows.
>As I do a TABLEUPDATE, instead of saving those changes to the table, all the rows will get the same value for that field (it will save the last value changed for that field).
>Example:
>Field hrnotes row 1 changed to ‘A’
>Field hrnotes row 2 changed to ‘B’
>Field hrnotes row 3 changed to ‘C’
>Field hrnotes row 4 changed to ‘D’
>When I do table update:
>xSuccess=TABLEUPDATE(1,.T.,'cMyTable')
>row 1 changed to ‘D’
>row 2 changed to ‘D’
>row 3 changed to ‘D’
>row 4 changed to ‘D’
>HELP!
>Thank you all!
>
>Here’s my setup:
>
>
>xRefno=’0400001’
>lSuccess=SQLEXEC(THIS.lnHandle,"SELECT myTable.empid,hrnotes,accnotes,trefno,lastupdate,lastupdateby ;
>FROM myTable WHERE tRefno='&xRefNo'","cMyTable")
>
>
>IF lSuccess>0
>
> SET MULTILOCKS ON CURSORSETPROP('Buffering',5, ‘cMyTable ')
> CURSORSETPROP('TABLES','ERCAsFor',' cMyTable ')
> CURSORSETPROP('UPDATABLEFIELDLIST','empid,trefno,hrnotes,accnotes,lastUpdate,lastUpdateBy',' cMyTable '
> CURSORSETPROP('KeyFieldList',trefno',' cMyTable ')
> CURSORSETPROP('UpdateNameList','empid MyTable.empid, ercarefno MyTable.ercaRefNo, hrNotes MyTable.hrNotes, ;
> accNotes MyTable.accNotes, lastUpdate MyTable.lastUpdate, lastUpdateBy MyTable.lastUpdateBy',' cMyTable ')
> CURSORSETPROP('FetchMemo',.T.,' cMyTable ')
> CURSORSETPROP('SendUpdates',.T.,' cMyTable ')
>
>ELSE
> MESSAGEBOX('Error retrieving',16,'ERROR')
>ENDIF
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform