Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Problem with CursorSetProp -SQL SERVER communication
Hello all
I am trying to delete some records (on SQL server) using SPT
cSQL = "select * from fvalues"
lsuccess=SQLEXEC(nConnHandle, cSQL, 'TEMP')
********** make the cursor TEMP updatable
cKeyField = "TAG_P,TAG_M,TAG_L,TAG_F" && MY UNIQNESS
cRemoteTable = 'fvalues'
=CursorSetProp("KeyFieldList", cKeyField )
=CursorSetProp("WhereType", 1)
=CursorSetProp("Tables", cRemoteTable)
=CursorSetProp("SendUpdate", .T.)
.....
=CursorSetProp("UpdateNameList", lcField)
......
=CursorSetProp("UpdatableFieldList", lcField)
.....
Then I am trying to delete some records as follow :
*****************************************************
SELECT TEMP
DELETE ALL FOR TAG_P < 10 &&which i have doublicated values
x=TABLEUPDATE(.T.,.F.)
IF x=.f.
MESSAGEBOX('problem updating')
=TABLEREVERT(.T.)
RETURN
endif
the update cannot be done because there are doublications in the KeyFieldList.
Is this the correct way to setup the KeyFieldList of multible keys ?
cKeyField = "TAG_P,TAG_M,TAG_L,TAG_F" && MY UNIQNESS
=CursorSetProp("KeyFieldList", cKeyField )
Thanks in advance
Petros
Note : With SPT is working fine
lsuccess=SQLEXEC(nConnHandle, 'DELETE FROM FVALUES WHERE TAG_P < 10')
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement