General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
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