Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object reference lost in SQL SELECT ?
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01120146
Message ID:
01120235
Views:
15
>It's much cleaner to use TEXTMERGE
>
>TEXT TO cSQLStatement TEXTMERGE NOSHOW PRETEXT 15
>SELECT column1, column2, "<<alltrim(object1.object2.property1)>>" as column3
>FROM cursor1
>INTO CURSOR cursor2 READWRITE
>ENDTEXT
Sergei,

my general case is that SQL statement could use both object properties as well as columns of the original cursor to create new columns in the destination cursor, for example:
cSQLStatement = SELECT column1, column2, alltrim(object1.object2.property1) as column3,;
 alltrim(cursor1.LastName + cursor1.FirstName) as FullName FROM cursor1 INTO CURSOR cursor2 READWRITE

&cSQLStatement
Although object properties are constant, and the TEST TO approach would work, the same approach could not be applied to reference other columns (cursor1.LastName + cursor1.FirstName) to create a new column. Therefore, it looks like I am stuck with the macro substitution. Therefore, the problem still remains: macro substitution seems to mess-up the object properties, or am I doing anything wrong?

Thanks again,
Igor.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform