Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Your information in this site is absolutely WONDERFUL. It is the most useful site on the web to me right now. Thank You Thank You..."

Geography

Where in the world do Tek-Tips members come from?

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

Foxtrotter (IS/IT--Management)
5 Apr 11 16:53
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.
 
DSummZZZ (Programmer)
6 Apr 11 11:36
Have you tried something besides select *?  Maybe on or two fields instead of the entire record?
I'm wondering if memlimit settings may make a difference too.
 

  -Dave Summers-  
 cheers
Even more Fox stuff at:
http://www.davesummers.net/foxprolinks.htm

Foxtrotter (IS/IT--Management)
6 Apr 11 11:47
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.
Foxtrotter (IS/IT--Management)
6 Apr 11 12:30
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.
DSummZZZ (Programmer)
7 Apr 11 13:00
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:
http://www.davesummers.net/foxprolinks.htm

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close