Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executing a SQL Server stored procedure
Message
 
À
05/03/2001 23:58:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00482118
Message ID:
00482142
Vues:
16
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform