Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting SQL Server stored proc return value
Message
From
07/12/2003 17:06:13
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00856398
Message ID:
00856728
Views:
16
Hi Sergey.

First, it pops up View parameter dialog.

This is because you did not initialize the parameter puRetVal. Because puRetVal is Private in scope, declaring it does not initialize it.

If I enter anything, ODBC error is generated "[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure proc_test has no parameters and arguments were supplied".

I am no SQL Server guru, but this error is telling me that you did not declare the output parameter in your stored procedure. Try using this as your stored procedure:
CREATE PROCEDURE proc_test @puRetVal integer output
AS
set @puRetVal = 10

GO
Now in VFP, try calling it using this code. Of course, if you have changed the login from its default user id of sa and no password, substitute accordingly < g >.
PRIVATE puRetVal
puRetVal = 0
nCon = SQLCONNECT( 'master', 'sa', '')
SQLEXEC( nCon, [EXEC proc_test ?@puRetVal] )
?puRetVal  && should echo back 10
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform