General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
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')
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only