Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I avoid 'SQL: Statement too long (Error 1812)'
Message
De
14/11/2003 03:09:53
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
12/11/2003 13:27:23
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00849187
Message ID:
00849764
Vues:
28
>Hello.
>
>I programatically build a SQL select statement stored in a string variable. I then macro expand the variable and get:
>
>SQL: Statement too long (Error 1812)
>
>What is the limit to the statement? Is there any way to work around this?
>
>TIA
>
>Regards,
>
>Mike

Mike,
I couldn't browse the whole thread and somewhere along lines I saw you were doing something like :
where myfield = '1234' or myfield = '29929' or myfield ...

This ORing might be many and adds to complexity of SQL even if it could ran.
When I need such things I simply create a cursor and put values there, make an inner join. ie:

create cursor crsTemp (myField i)
insert into crsTemp values (1234)
insert into crsTemp values (29929)
...

select .... from myTable mt ;
inner join crsTemp lst on val(mt.Myfield) = lst.myField ...

Just my .02 cents
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform