Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT command, longer than 255 characters
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00152131
Message ID:
00152622
Views:
14
Hi there Barb.

>Danijel (nice picture, by the way)
Oh, thanks, I look quite different now though(short hair etc.). Not so bad yourself, at all...
>
>I've found it's useful from a debugging standpoint to divide my strings into FIELDS, TABLES, FILTER and ORDER clauses, so the SQL looks like
>
>SELECT &cFields from &cTables;
> WHERE &cFilter into cursor MyCursor ordered by &cOrder
>
>Much simpler to handle it all.
>
>HTH
>Barbara
>
>>SQL select can go up to 2000+ characters, but you should probably build up a text-string variable instead of merging and compiling a .prg. It will perform better as well. Ex.:
>>lcSel = "SELECT "
>>lcSel = lcSel + "SomeFields" + " FROM "
>>lcSel = lcSel + "SomeTables" + " WHERE "
>>lcSel = lcSel + "Condition"
>>&lcSel
>>I do it that way and it works great.

I do it exactly like you mention, my example above was more to give the person in need an idea of how it can be done. I even include keywords in those variables so that SQL itself is like:
&lcSel &lcFrom &lcCond &lcInto &lcOrder &lcGroup
Best
Danijel
Previous
Reply
Map
View

Click here to load this message in the networking platform