Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL sum() on 186 fields causes crash
Message
 
 
À
13/09/2000 11:13:04
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00415834
Message ID:
00415844
Vues:
23
How you call this SQL? '&' or PRG file compiling?

In fact, SQL SELECT command may contain much more that 4K of characters. Never have had a problems with that in our query builder.

Try to add chr(13) + chr(10), not just chr(13) to separate lines.
In addition, I run such queries ONLY by putting them into PRG file, compiling and than running. Because VFP '&' (macro) does not works in many cases for multi-line commands.
Finally, you do not need to separate all items. Just keep 1 line less than 255 characters.

>I have an intermediate cursor with 192 fields. I need to 'SQL' sum fields 7-192. First I did this :
>
lcPattx = ''
>for ix = 1 to 186
> lcPattX = lcPattx + ;
>   ',sum(T'+padl(ix-1,3,'0')+') as T'+padl(ix-1,3,'0')
>endfor
>select f1,f2,f3 &lcPattX from ...
Then this :
>
lcPattx = ''
>for ix = 1 to 186
> lcPattX = lcPattx + ;
>   'sum(T'+padl(ix-1,3,'0')+') as T'+padl(ix-1,3,'0')+', ;'+chr(13)
>endfor
>_cliptext = lcPattX
and pasted the code. I even tried removing 'as ...' part. Total commandline length is 4199 at max. Both approaches crash VFP. Any ideas other than not using SQL ? TIA
>Cetin
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform