>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