Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXECCommands with parameters
Message
From
13/12/2000 10:50:44
 
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00452765
Message ID:
00452845
Views:
33
Yeah, sorry. I know this but I was looking for a way to do this without creating a cursor. I just thought that because it is possible to pass vars into sps by reference it would also be possible to pass them into sql statements...

>Hi!
>
>You don't need it. With SQL Server following works very well:
>
>SQLEXEC( lnHandle, "SELECT COUNT(1) as MyCount FROM Customer", "MyCursor")
>*returns cursor MyCursor with 1 column MyCount and 1 row in it that contains count
>
>SQLEXEC( lnHandle, "SELECT MyVar", "MyCursor")
>* same as above - get some variable value
>
>Just get value from cursor and close it - you're there.
>
>>Hi,
>>
>>Is it possible to pass a var by reference in an sqlcommand to get the results of a sqlcommand?
>>
>>That is, I know its possible to do the following from fox:
>>
>>SQLEXEC( lnHandle, "SELECT * FROM Customer WHERE Id = ?lnId", "Results") where lnId is a fox var, but is it also possible to do something like the following...
>>
>>SQLEXEC( lnHandle, "SELECT ?lnCount = COUNT(1) FROM Customer")
>>where UDFPARMS are set to reference
>>
>>Can anyone let me know the correct syntax?
>>
>>Thanks
>>
>>Mace
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform