Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement too long
Message
De
15/08/2004 21:30:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
15/08/2004 20:52:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00933445
Message ID:
00933448
Vues:
19
Perhaps the real issue is "your statement is too complicated", "too many parts to combine with AND/OR", or something similar.

As a workaround, try to put some of the rules into tables, cursors, or some other way to take some part out of the SQL statement proper. I am not sure how this would be done in this particular case, but to explain what I mean, let me give an example. If you want to check for various possible values, you might use a single INLIST(), or a series of statements combined with OR. Your SQL statement will get longer and longer, as you add more details.

Putting the options into a cursor, you can change the SQL statement in my example from:
... Field1 = "a" or Field1 = "b" or Field1 = "c"
(or the equivalent inlist()), to:
... Field1 in (select Field1 from TempCursor)
This option is much more scalable.

In your example - if I interpret it correctly - you might try to have a cursor with all acceptable combinations of cDataSet and Product.

>Hi Folks,
>
>Larry Rix here from Platts. I ran into an issue tonight that I can find references to here on the UT, but not an apparent solution. Perhaps you folks can assist.
>
>I have a SQL statement that is built like:
>
>
>LOCAL ;
>   lc_sql as String
>
>...
>
>lc_sql = ;
>   " SELECT " + ;
>   ...
>
>...
>
>&lc_sql
>
>
>When the macro is executed, I get an error message (1812) that says that the object code is too large to execute. I have checked the SQL statement and it is 2588 characters in length (way smaller than the 8192 in the system limits). Here is the SQL for those of you that might like to see:
>
> ...

>Has only ever seen anything where the SQL engine complains about length of the object code, but that the real issue is something else in how the SQL is constructed? I am at a total loss at this point.
>
>I apologize that the SQL is not formatted. You are seeing it above as it was copied from the code. I used an
ASSERT (( .f. )) MESSAGE "debug: What is the SQL?"
to stop and grab the SQL with a
_CLIPTEXT = lc_sql
.
>
>Thanks so much for your assistance.
>
>
>Cheers,
>
>Larry Rix
>Platts
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform