Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT command, longer than 255 characters
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00152131
Message ID:
00152622
Vues:
15
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform