Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL-statement too long???
Message
From
21/09/1998 06:39:44
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
21/09/1998 05:31:56
Marco Beuk
Innovero Software Solutions
The Hague, Netherlands
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00138926
Message ID:
00138959
Views:
17
>>>When i paste a SQL-statement generated by a view i get an 'unrecognized phrase/keyword in command' error.
>>>Only when i reduce my SQL-statement in my SQLEXEC() to 255 characters or less it works.
>>>
>>>Why can't i use strings larger then 255 characters?
>>>
>>>Marco Beuk.
>
>>A single line of code cannot be > 255 characters, however a single command can be up to 8192 characters long.
>
>>You need to use the ; syntax to break up the command into a number of lines.
>>Regards
>>Mark
>
>The SQL generator for the view does that for me, but still, it doesn't work.
>
>The following command errors 'unrecognized phrase/keyword in command' because it contains more then 255 characters:
>
>SQLEXEC(nHandle,"SELECT B_org.ORGID, M_internet.INTOMS AS email,;
> M_adres.ADRSTRPB AS straat, M_adres.ADRHSPBNR AS huisnr,;
> M_adres.ADRHSPBPC AS postcode, M_adres_a.ADRSTRPB AS postbus,;
> M_adres_a.ADRHSPBNR AS postbusnr, M_adres_a.ADRHSPBPC AS Snip....

Ah, now I see.

The problem is that the ; are appearing in the middle of a character string. You will have to treat each line as a separate string and concatenate them.

e.g.
SQLEXEC(nHandle,"SELECT B_org.ORGID, M_internet.INTOMS AS email, " + ;
"M_adres.ADRSTRPB AS straat, M_adres.ADRHSPBNR AS huisnr, " + ;
"M_adres.ADRHSPBPC AS postcode, M_adres_a.ADRSTRPB AS postbus, " + ;
"M_adres_a.ADRHSPBNR AS postbusnr, M_adres_a.ADRHSPBPC AS " + ;

etc...

Also, it would be a good idea to add a space to the end of each line to ensure that the next line isn't joined directly without any space.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Reply
Map
View

Click here to load this message in the networking platform