Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting SQL Server stored proc return value
Message
De
07/12/2003 17:06:13
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00856398
Message ID:
00856728
Vues:
15
Hi Sergey.

First, it pops up View parameter dialog.

This is because you did not initialize the parameter puRetVal. Because puRetVal is Private in scope, declaring it does not initialize it.

If I enter anything, ODBC error is generated "[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure proc_test has no parameters and arguments were supplied".

I am no SQL Server guru, but this error is telling me that you did not declare the output parameter in your stored procedure. Try using this as your stored procedure:
CREATE PROCEDURE proc_test @puRetVal integer output
AS
set @puRetVal = 10

GO
Now in VFP, try calling it using this code. Of course, if you have changed the login from its default user id of sa and no password, substitute accordingly < g >.
PRIVATE puRetVal
puRetVal = 0
nCon = SQLCONNECT( 'master', 'sa', '')
SQLEXEC( nCon, [EXEC proc_test ?@puRetVal] )
?puRetVal  && should echo back 10
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform