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
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