Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stored Procedure Good/Bad? How?
Message
 
À
12/01/2001 13:06:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00463078
Message ID:
00463084
Vues:
18
>I am trying to increase the performance our programs. At the present we do all processing on the client side. I have heard that it is better to do this on the server side. This I assume means STORED PROCEDURES. Question, are they faster for SQL statements. The following works:
>
>nconhandle = sqlexec(nhandle, mysqlstatement, 'mycursor')

Yes, generally it is better to use stored procedures on the server (SQL Server 7 in my case). Your stored procedure (sproc) can do a number of things, including returning a set of records (result set).

You can create a sproc called usp_GetCustomers, that creates a record set of companies, and call if like this from your VFP code:

nconhandle = sqlexec(nhandle, "EXECUTE sp_GetCustomers, 'mycursor')

IF nconhandle = 1, the customers specified in your sproc will be in mycursor.

I use a mix of sprocs and remote views.

>From here I can use the cursor I retrieved. What I would like, is to have the statement on the server in a stored procedure. If that is the way to go for this kind of data retrieval. What I don’t know is how to call that procedure and return the cursor.
>
>We are using VFP6 SP3 with a standard VFP database.
>
>Any & all thoughts are welcome.
>TIA
>Mike
Chris McCandless
Red Sky Software
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform