Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp Stored procedure help
Message
 
 
To
07/01/2004 16:38:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00864863
Message ID:
00864883
Views:
10
>Hello all
>
>I have 12 tables say empJan,empFeb,empMar...empDec.how can i get the data for the range that user specifies. for eg if user selects JAN..MAY, i need to get data into one cursor. right now i use procedure code to do this, is it possible thru SQL/ Stored Procedures.

It is possible through SP/SQL, however, your code in a SP would most likely look about the same as what you use in your Procedure code. The SQL would look something like:
SELECT * from empJan WHERE ...
UNION
SELECT * from empFeb WHERE ...
...
UNION
SELECT * from empMay WHERE ...
ORDER BY
INTO CURSOR crsResults
This assumes each table structure is IDENTICAL. This SQL you can generate programmatically based on the user input.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform