Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing a SQL Server stored procedure
Message
 
To
05/03/2001 23:58:56
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00482118
Message ID:
00482142
Views:
15
Hi Sanjay,

You can trap SQL errors by using the AERROR() function. It creates an array with the VFP's error number, message, ODBC's error number, message, etc. Check out at VFP's help file.

About executing a SQL Server Stored Procedure:

It's like a usual SELECT statement. Just use the SQLEXEC() function.

Example: SQLEXEC(myHandle, "EXECUTE myStoredProc 'myfisrtParam', 'mySecondParam'", "myCursor")

To tell you the truth, i never tried a storep procedure with an Output parameter. I think you're doing this, because you need a NOT INTEGER return value.

You can do also with an expression like this at the end of the Stored Procedure:

-- @myReturn is the value i want to return
SET @myReturn = (SELECT name FROM Customers WHERE ...)
SELECT @myReturn AS myName

At VFP, you could work like this:

SQLEXEC(myHandle, "EXECUTE myStoredProc", "myCursor")

WAIT WINDOW myCursor.myName



Good luck,


Ricardo
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform