Error "Compiled code for these line to long (1252)" with FPW 2.6 
Author Message
 Error "Compiled code for these line to long (1252)" with FPW 2.6

Hallo,
we are having problems with a macro-substitution command. We try to execute
SQL-statemment, stored into a variable with a macro-subst. like this :

sqlstmt = "SELECT x,b FROM ....."    && this stmt is generated (not fix)
&sqlstmt                             && execute it

There seems to be a problem, when the length of the statement is more tha
than 1400 chars.When we try to execute the statement the above mentioned
error occurs. Although the max. length of a macro-subs. should be 2048
chars |?
Does somebody has an idea, how to solve this problem or has an idea
hot to execute the SQL WITHOUT the macro subst ?
We appreciate ANY ideas.
Thanks in advance
Ingo Stephany



Sat, 31 Jul 1999 03:00:00 GMT  
 Error "Compiled code for these line to long (1252)" with FPW 2.6



Quote:
> Hallo,
> we are having problems with a macro-substitution command. We try to
execute
> SQL-statemment, stored into a variable with a macro-subst. like this :

> sqlstmt = "SELECT x,b FROM ....."    && this stmt is generated (not fix)
> &sqlstmt                             && execute it

> There seems to be a problem, when the length of the statement is more tha
> than 1400 chars.When we try to execute the statement the above mentioned
> error occurs. Although the max. length of a macro-subs. should be 2048
> chars |? <snip...>

Ingo,

Try splitting up the SELECT-SQL statement into several different parts,
still using macro substitution like:

lcFields = 'Field1, Field2'
lcTable = 'TableName'
SELECT &lcFields FROM &lcTable

This should eliminate the need to worry about the length of the string
being substituted.
--
Jon Ziegler
Vertex Software, Inc.
http://www.vsiweb.com



Sun, 01 Aug 1999 03:00:00 GMT  
 Error "Compiled code for these line to long (1252)" with FPW 2.6

Jon,
thanks for your suggestion. But we tested it already this way without
success:

Quote:
>lcFields = 'Field1, Field2'
>lcTable = 'TableName'
>SELECT &lcFields FROM &lcTable

and   - &lcselect &lcfromtab &lcwhere didn't work also.

Perhaps there's another way to execute a generated SQL against
a Database ? Maybe the problem is not the length of the SQL
rather than something inside the statement ?
--------------------------example on-------------------------------------
SELECT DISTINCT n5.ppersnr, n5.pkdstatus, n5.sec_key, n5.PNAME, n5.PVORNAME
, n3.PADRVERW, n3.PBRANRED, n3.PBUNDLAND, n3.PLANDKZ, n3.PNAMEZUS, n3.PORT1,
n3.PORTZUSATZ, n3.PPLZ1, n3.PPOSTTYP, n3.PSEKTOR, n3.PSTRASSE, n6.PANREDKZ
AS CAA, n6.PNAME AS ZAA, n6.PTITEL AS SBA, n6.PVORNAME AS TBA, n6.PGEBDAT
...
PV_ZUSAM b  , P_ADRESS n3, P_ADRESS n4, PDETAIL n8  WHERE n5.pnajukz=1
AND n5.ppersnr=a.p_zfuehr AND ((n7.PEKL<3) ) AND (n5.ppersnr NOT IN
(SELECT cu.p_zfuehr FROM pv_zusam cu,vvnvp mx,vv_allg je WHERE
cu.ppersnr=mx.ppersnr AND mx.beziehung="VN  " AND
mx.vversnr=je.vversnr AND je.valspa_ken IN
("PU ","U  ","-U-","BUK","JGU","JU ","UBR","WSU")))
AND n5.ppersnr=c.p_zfuehr AND c.ppersnr=nb.ppersnr
AND  nb .pgrupptyp='002' AND  nb.PFUEHRKZ AND
n6.ppersnr=d.p_zfuehr AND d.ppersnr=nc.ppersnr
AND nc.pgrupp_pid=nb.pgrupp_pid AND
nc.PGRUPPBEZ IN("001","002","006","005")
AND n6.ppersnr=b.p_zfuehr AND n5.ppersnr=n7.ppersnr
AND n5.ppersnr=n3.ppersnr AND n6.ppersnr=n4.ppersnr
AND n6.ppersnr=n8.ppersnr AND n5.ppersnr >"EZZZZZZ"
AND n5.ppersnr <="KZZZZZZ" INTO DBF xy
----------------------------exmaple off---------------------------
Is it possible that the FoxPro compiler substitutes the SUB-SELECTS
with something and is exceeding this way the length of 2048 ?
Regards
Ingo Stephany



Sun, 01 Aug 1999 03:00:00 GMT  
 Error "Compiled code for these line to long (1252)" with FPW 2.6

Jon,
some more information on this subject. The max.line of "compiled code"
is 1024 Byte | The max char length of a macro-subst. may be 2048, but
our border here is the generated code, and that' obviously more than 1024.

More infos can be found at : http://www.microsoft.com/kb  Article:Q111991

But,perhaps there's another way to execute a dynamic SQL against
a Database ?
Thanks
Ingo Stephany
PS: Splitting the SQL into several statements seems not to be an
    option at the moment.



Sun, 01 Aug 1999 03:00:00 GMT  
 Error "Compiled code for these line to long (1252)" with FPW 2.6

Quote:
> we are having problems with a macro-substitution command. We try to
execute
> SQL-statemment, stored into a variable with a macro-subst. like this :

> sqlstmt = "SELECT x,b FROM ....."    && this stmt is generated (not fix)
> &sqlstmt                             && execute it

> There seems to be a problem, when the length of the statement is more tha
> than 1400 chars.When we try to execute the statement the above mentioned
> error occurs. Although the max. length of a macro-subs. should be 2048
> chars |?
> Does somebody has an idea, how to solve this problem or has an idea
> hot to execute the SQL WITHOUT the macro subst ?
> We appreciate ANY ideas.

Know the problem, when I was building my query I forgot to put several
alltrim() calls in it so there were a lott of unused spaces in my query, if
so, remove the spaces.
If your query is really that long you should think of running it in two
smaller queries.
The problem is not the macro length but the length of a compiled line of
code in foxpro. You've reached the limit.....


Tue, 03 Aug 1999 03:00:00 GMT  
 Error "Compiled code for these line to long (1252)" with FPW 2.6

Quote:
>   Jon,
>   thanks for your suggestion. But we tested it already this way without
>   success:
>   >lcFields = 'Field1, Field2'
>   >lcTable = 'TableName'
>   >SELECT &lcFields FROM &lcTable

>   and   - &lcselect &lcfromtab &lcwhere didn't work also.

>   Perhaps there's another way to execute a generated SQL against
>   a Database ? Maybe the problem is not the length of the SQL
>   rather than something inside the statement ?

Hallo! I am not intruding, am I?
I can propose another way, though slightly weird one. You could generate
your SELECT to a file and then say DO <that file>. In such a way you'll
avoid using macro substitutions. Maximal length of macro substitution is
definitely less than maximal length of a plain command and is much less than
1024, 2048 or whatever big number Fox's help asserts it is. Using an external
file allows you to benefit a longest command line Fox can afford. And I don't
think it would make program's performance drastically down.

Good luck,



Thu, 05 Aug 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. "Line too long to fit" Error

2. Q: "LINE TOO LONG"

3. Table update Problem - "line too long"

4. "line is too long"

5. FPW 2.6 "feature not available" error

6. FPW26 Compiled code for this line too long

7. FPW 2.6 "READ CYCLE" question

8. FPW 2.6 "Missing memo file"

9. Paths to "files" in FPW 2.6

10. FPW 2.6 "Now Printing" window

11. String too long in PICTURE "@M"

12. FPW 2.6: Need a "recno()" for index "order" (Hard to explain)

 

 
Powered by phpBB® Forum Software