Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combine 2 or more cursors
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00568592
Message ID:
00569199
Views:
22
Doron,

If you have fields with the same name in different tables (cursors) and you do
SELECT * from Table1 join Table2 ...
You will have fields like field1_a, field1_b, etc. in the result. In our query engine we wrote a special method to change all names with _a suffix to name without it. We also added a routine to get rid of NULLs, which are produced as a result of left (right/outer) joins.

>Hi Sergey,
>
>The theory with all macro under same SQL statement does not work.
>VFP is looking at one command at the time, and when expanding all macros
>under same command and if it is greater then 8192 it will produce
>an error.
>
>See this link as well:
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fox7help/html/conSystem_Capacities.asp
>
>Also if I break those field as suggested at first like the following it will
>pass the 8192 characters limit, that does not work as well since at the bottom
>I entered all fields names and exprssions into an SQL statement and that will
>pass the 8192 characters limit as well.
>
>SELECT aaa, bbb, RECNO() as rn ;
> FROM temp1 ;
> INTO CURSOR xxx1
>
>SELECT ccc,ddd, RECNO() as rn ;
> FROM temp2 ;
> INTO CURSOR xxx2
>
>SELECT ;
> xxx1.aaa ,;
> xxx1.bbb ,;
> xxx2.ccc ,;
> xxx2.ddd ;
>FROM ;
> xxx1 ;
>INNER JOIN XXX2 ;
> ON xxx1.rn==xxx2.rn ;
>INTO CURSOR ResultCursor
>
>If I add the following:
>This way no need to enter all exprssions but I will fields like RN
>all over.
>
>SELECT *;
>FROM ;
> xxx1 ,;
> xxx2 ;
>INNER JOIN XXX2 ;
> ON xxx1.rn==xxx2.rn ;
>INTO CURSOR ResultCursor
>
>Regards,
>
>Doron
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform