Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling stored procedure in SQL server
Message
De
06/04/1999 18:16:18
 
 
À
06/04/1999 12:23:30
Vytautas Racas
Norway Registers Development
Kaunas, Lithuania
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00205620
Message ID:
00205800
Vues:
15
Here is a simple example if you wanted to return the system date from SQL Server

To create the stored procedure from VFP (do in command window as you only need to run once):

SQLEXEC(gnCH,"CREATE PROCEDURE sp_getdate @date datetime;
OUTPUT AS SELECT @date = getdate()")

To return the SQL Server System date in your app execute the following:

sqldate = ""
SQLEXEC(gnCH,"{call sp_getdate(?@sqldate)}")

sqldate will now equal the datetime returned from the server

Not sure how much detail you want here. You could also pass parameters from VFP to SQL Server to utilize in the Select statement, and as long as your return paramater returns one value (in the case above, @date) it can be passed back to VFP.

Don't forget you may have to assign permissions in SQL Server to be able to execute the stored procedure from your application.

For more information check out the VFP programmers guide page 574 for version 6.0. It is not much but it can give you a little more info.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform