Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored Procedure
Message
From
26/09/2002 16:00:48
 
 
To
26/09/2002 05:07:52
Kumar Anturekar
Tandon Information Solutions Pvt. Ltd.
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00704587
Message ID:
00704944
Views:
17
I'm not sure that you can get what you want. When a error is raised, SQL Server sends the error to the client. You do have the opportunity to get the error number with @@ERROR but the message is already starting to bubble up.

Probably the best you could do is provide a wrapper around the call to SQLEXEC() that captures the error information and converts it to the form that you want.

-Mike

>Hi,
>
>I am excuting a stored procedure of SQL2000 from VFP using SQLEXEC().
>
>This Stored Procedure (lets say usp_1) In turn calls another Stored (lets say usp_2)Procedure to Insert Records into the different Tables in a Database.
>
>sErrorStr = ""
>=SQLEXEC(nHandle,"EXEC usp_1 ?sErrorStr")
>
>Now usp_2 is passing a prameter (OUTPUT) to usp_1, which is the error number generated (if at all) by the insert statements (or 0 if none). I have used the @@ERROR immediately after every insert statements.
>usp_1 accepts this parameter passed by usp_2 and based on some logic passes the necessary output ( which is a string ) to VFP's output parameter
>
>What is happening is whenever there is a error in the usp_2 at the time of insert the whole procedure is terminated and the output of SQLEXEC() is -1.
>
>What i want is that it should return the error code to usp_1, which will then pass the necessary output to VFP's output parameter (sErrorStr).
>
>Please help...
>
>Kind Regards,
>KUMAR.
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform