Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Current and History Data
Message
 
 
To
12/04/2005 10:37:32
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01003742
Message ID:
01003745
Views:
15
>I have the need to create a SQL statement that pulls data from payroll check current and history files. These files a VFP 6.0 free tables with exactly the same structure. These tables also do not include a unique key. The problem is if I issue a statement such as "select * from G:\Sbtpr\PRAXIS\prchck01,G:\Sbtpr\PRAXIS\prhchk01 into cursor tccursor" the computer slows to a crawl and eventually I get an error message stating the bla bla bla temp file is too large. If I change the SQL statement to only pull from on file at a time there are now issues at all. Separately it is actually quite fast. If I specify specific fields in the combined statement I get an error stating that the first field requested in not unique. I am sure this is because the same field name exists in both tables. Can I have one SQL Statement to pull data from both files?

Use UNION
SELECT * FROM CurrentData ;
  WHERE < whatever condition > ;
UNION ALL
SELECT * FROM HistoryData ;
  WHERE < whatever condition > ;
...
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform