Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting a return value from a SQL stored procedure.
Message
From
13/04/2005 07:36:37
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01004084
Message ID:
01004094
Views:
21
Hi Sergey,

This is what I have :-
? SQLEXEC(4, [{?@nOutVal=CALL Claim.dbo.RepairSP_UpdateRepairOrder 261657,5002,'',NULL,NULL,NULL,NULL,NULL,NULL,0.000000,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,'',4,15358,NULL,NULL,NULL,1,NULL,1,NULL}])
However, nOutVal is staying at its initialised value ie., NULL. The stored procedure being called simply accepts the above values and the first "valid" line says :-
RETURN -1
FYI, at run time, the 2nd parameter of SQLEXEC (as above) is passed as a variable to a method that calls SQLEXEC(). However, the above code does not run from the command window so, I still seem to be doing something wrong.

Any ideas?

Thanks,

>Hi Gary,
>
>See Re: Can stored procedures return values? Message #876903
>
>>
>>Can anyone give me some sample syntax for getting a return value from a Stored procedure?
>>
>>I am sure that Sergey has posted similar code in the past. I am sure you need to use CALL rather than EXEC in order to get the return value. This is what I have so far and it doesn't want to play ball :-
>>
>>
>>PRIVATE nOutVal
>>nOutVal = .NULL.
>>
>>SQLEXEC(4, "{CALL nOutVal = Claim.dbo.RepairSP_UpdateRepairOrder 261657,5002,'',NULL,NULL}")
>>
>>
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform