Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error #1252 "Compiled code for this line too long."

Status
Not open for further replies.

Foxtrotter

IS-IT--Management
Jan 5, 2011
57
US
Hi,

I'm getting an Error# 1252 "Compiled code for this line too long" from foxpro 2.6a trying to execute a simple select statement from a real SQL table using the connectivity kit (fpsql.fll).

I have already read all the stuff about there being a limit of 1024 bytes for the compiled code. The statement I'm trying to execute is simply:
SQLString = "select * from sqltable where id = 123456"
resultcode = dbexec(ConnNo,SQLString,'Results')

No way this is greater than 1024 bytes however, the data coming back has around 95 fields with a record length around 983 bytes.

Can anyone explain what's going on here so I can figure out my workaround? By the way, this works fine in VFP but I have to make this work in an existing Fox 2.6a app.

Thanks for any suggestions.
 
Hi Dave. I was hoping you might comment on this. I have tried executing a stored procedure but it also returns back a long list of columns but has the same error. I can issue a select with a short list of columns just fine.

The memlimit settings is an interesting thought though. Maybe I'll look in that direction.

Thanks for any other suggestions you might have.
 
MEMLIMIT = 90,2048,16384 is what we have been using. I can't find documentation on what the maximums for MEMLIMIT is so I'm not quite sure what it should be configured to. I did find documentation that states that 255 columns is the max fields for a SQL SELECT statement, I assume this would also apply to an actual dbexec call as well. I am well below this number.

Also, just to clarify, I have just a test .prg setup that does nothing but setup a connection and try to execute the SQL statement, so this is not currently part of the whole application, just bare essentials.

Thanks.
 
In my config file I have the following which has worked for years.
MEMLIMIT=60, 2048, 16384
mvcount=2048

I don't know that 90 instead of 60 in the first parameter would be better or worse.
But that said, if you are able to run the query with fewer fields and it works, it would seem that somewhere in the compiled code the field list is being included. Maybe being translated on the fly by dbexec()? Dunno. I've never used the connectivity kit. However, our company tried to use a 3rd party Oracle interface once and it did exactly that. It took the '*', mapped it against the data dictionary for the table and substituted it with the complete field list.

You say there are 95 fields in your table. If each is 10 characters (which I believe are preallocated in FoxPro), that's 950 characters. Add the rest of the command and you end up with well over 1024 characters.



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top