Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indirect join
Message
 
To
20/11/2006 13:22:19
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01171237
Message ID:
01171246
Views:
7
>The following code sequence will work fine
>
>lcRawData = addbs(fileloc) + "surveys/RawData2005"
>rawdata = 'RawData2005'
>lcPermID = '20011'
>lcJoincondition = 'Companyinfo.company = RawData2005.company'
>
>SELECT Companyinfo.*, (lcRawData + '.*');
> FROM ;
>     COMPANYINFO ;
>    INNER JOIN (lcRAWDATA) ;
>   on Companyinfo.company = RawData2005.company ;
> WHERE  Companyinfo.permid = ( "20011" )
>
>
>but this one will not
>
>
>lcRawData = addbs(fileloc) + "surveys/RawData2005"
>rawdata = 'RawData2005'
>lcPermID = '20011'
>lcJoincondition = 'Companyinfo.company = RawData2005.company'
>
>SELECT Companyinfo.*, (lcRawData + '.*');
> FROM ;
>     COMPANYINFO ;
>    INNER JOIN (lcRAWDATA) ;
>   on Companyinfo.company = (lcRawData + '.company') ;
> WHERE  Companyinfo.permid = ( "20011" )
>
>
>The construct fails with the indirect pointer in the 'ON' statement. I've tried every combination of (), "", and & that I can think of but can't seem to make it work. The query will run without error but it doesn't find any records. Any help will be greatly appreciated.

Don, IMHO is better to use Text TO ... TextMerge...
lcRawData = addbs(fileloc) + "surveys/RawData2005"
rawdata = 'RawData2005'
lcPermID = '20011'
lcJoincondition = 'Companyinfo.company = RawData2005.company'

TEXT TO MySelect TEXTMERGE NOSHOW PRETEXT 15
SELECT Companyinfo.*, <<lcRawData>>.*
 FROM 
     COMPANYINFO 
    INNER JOIN <<lcRAWDATA>> 
   on Companyinfo.company = <<lcRawData>>.company 
 WHERE  Companyinfo.permid = ( "20011" )
 ENDTEXT 
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Reply
Map
View

Click here to load this message in the networking platform