Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Long SQL statement
Message
 
To
16/09/2002 09:57:47
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00700779
Message ID:
00700971
Views:
8
>Hello all, its been a while since I have had to do this, and I can't quite remember the proper steps for making this work. If I want to use &x to execute a SQL statement, but the string is too long to fit in the variable. What are the proper steps to execute the SQL statement? I thought I needed to put it into a memo field or something, but I can't seem to get it to work. Thanks for the help.

Here's another way to build a SQL string for execution:
TEXT TO lcSQL TEXTMERGE NOSHOW

SELECT MyField1, ;
       MyField2, ;
       MyField3, ;
   FROM MyTable ;
   ORDER BY MyField1, ;
   INTO CURSOR MyCursor	

ENDTEXT
lcSQL = CHRTRAN( lcSQL, CHR(9)+CHR(10)+CHR(13)+";", "" )
&lcSQL
This lets you build the statement as you want to without having to mess with quotes and + signs to concatenate everything together. I think it makes things much more readable. Just my 2 cents.

Cathy
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Previous
Reply
Map
View

Click here to load this message in the networking platform