Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting from intermediate result sets
Message
From
01/10/1997 12:32:57
 
 
To
01/10/1997 12:18:58
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00052669
Message ID:
00052690
Views:
29
>>>>>I need to select data using SQL Passthru ( SQLExec() ) from multiple permanent tables into an intermediate result set, then join the intermediate result set and some of the permanent tables to create a final result set. I cannot seem to be able to get this to work. Can this be done without using a stored prodecure, and if so, how? MS SQL Server 6.5.
>>>>>
>>>>>Thanks,
>>>>>Bill
>>>>
>>>>I think you should use stored procedure integrated into SQL Passthru (SQLExec(nConn,"execute proc1")). Actually VFP will get as many cursors as number of Select statements you will issue inside the procedure.
>>>
>>>Hi Edward,
>>>
>>>We will eventually include as stored procedure. Right now we are trying to develop the code. Are you saying to execute more than one SQl Select in a single SQLEXEC() statement? I was wondering if this could be done, but was not sure.
>>>
>>>Thanks,
>>>Bill
>>
>>Actually, I said that you can call stored procedure using SQLExec, and this stored procedure can include multiple SQL-Select commands, and here you get multiple cursors on front-end.
>
>Boy Edward, you are fast :-),
>
>Then how do you go about developing the code for a stored procedure wihtout putting it in a stored procedure, or is this possible? SQL book seemed to indicate temporary stored procedures could be created by including "#" somewhere in the definition?
>
>Bill

Yes you could, but it seems to me as not efficient way, because creating temp stored procedure you should tell SQL-Server all code which supposed to be inside this procedure, like:
@cSQL="CREATE PROCEDURE ... AS ..." /* all this code should be written once anyway */
execute @cSQL
Therefore, I would prefer static procedure accepting some parms to get more flexibility.
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform