Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parametrized update command
Message
From
02/04/2019 10:27:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01667828
Message ID:
01667831
Views:
46
>>>Hi,
>>>
>>>I am testing a parameterized update command (for SQL Server database) and having a problem. Here is my code:
>>>
>>>cSqlUpdate = "update mytable set field1 = ?" + cNewFld1Val + ", field2 = ?" + cNewFld2Val + " where pk = 10"
>>>lnResult = SQLEXEC( nSqlHandle, cSqlUpdate)
>>>
>>>I get a prompt to enter a value (as if I didn't specify the values cNewFld1Val or cNewFld2Val.
>>>Is this possible because the value of cnewFld2Val has a question mark ("?")?
>>>
>>>TIA
>>
>>cSqlUpdate = "update mytable set field1 = ?cNewFld1Val , field2 = ?cNewFld2Val where pk = 10"
>>lnResult = SQLEXEC( nSqlHandle, cSqlUpdate)
>
>Thank you! Rookie mistake.

It happens to most of us. :-)
Previous
Reply
Map
View

Click here to load this message in the networking platform