Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLEXEX() to call SQL Server stroed procedure
Message
De
31/03/2003 03:15:41
 
 
À
24/03/2003 17:51:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00769509
Message ID:
00771925
Vues:
13
Hi Miles,

>I need to update a SQL Server table. I want to create a simple stored procedure on the server to do the update. How do I call the stored proc and send a param with sqlexec(). Or is sqlexec() even the best route.
>

Here is an example:
CLOSE DATABASES all
CLEAR 

con=SQLCONNECT()

* create procedure
TEXT to cSql NOSHOW
	CREATE PROCEDURE #test_proc @val1 float, @val2 float, @result float OUT AS
	SELECT @result=@val1*@val2
ENDTEXT

IF 1!=SQLEXEC(con, cSql)
	AERROR(aerrors)
	DISPLAY MEMORY LIKE aerrors
ENDIF

res=0
v1=13
v2=129

* call procedure
IF 1!=SQLEXEC(con, "exec #test_proc ?v1,?v2,?@res")
	AERROR(aerrors)
	DISPLAY MEMORY LIKE aerrors
ENDIF

?"v1*v2=",v1*v2
?"res=",res

return
Thanks,
Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform