bfx: Field too large for a data item. Try to increase -s (42)

dwhite

Member
Hi,

I am getting a weird error when I try to do a check on the length of a string (to see if its null or zero) when the string gets past a certain size. I'm enclosing some code that you can use to recreate the error (in my code, I'm not using the DO LOOP, I'm just enclosing it so you can get a string the size that seems to error).
DEF VAR counter AS INTEGER NO-UNDO.
DEF VAR stringToCheck AS CHARACTER NO-UNDO INITIAL "".


DO counter = 1 TO 19244:
stringToCheck = stringtoCheck + "Q".
END.


DISPLAY (stringtoCheck = ? OR length(stringToCheck) = 0).

This doesn't make any sense to me. A string that is 19,244 characters long is valid, there shouldn't be a problem with checking it's length like that. If I put the length check into a variable like below it works fine.


DEF VAR counter AS INTEGER NO-UNDO.
DEF VAR stringToCheck AS CHARACTER NO-UNDO INITIAL "".
DEF VAR stringLength AS INTEGER NO-UNDO.


DO counter = 1 TO 19244:
stringToCheck = stringtoCheck + "Q".
END.

stringLength = LENGTH(stringToCheck).

DISPLAY (stringtoCheck = ? OR stringLength = 0).

This is very bizarre behavior. Does anyone know why this might be happening? I can think of no reason why it should be a problem to check the length of a string as part of an expression like I'm doing.
 
It will either be in the connection string you used to connect to the db, or in the pf file specified. If it's not there then it'll be the default value.
 
I think its set to 13500. But the weird thing is my example above will not fail on a string that is 19000 characters long. but it does on one exactly 19244.
 
That's probably -S, the port number. -s is the Stack Size. Mine is 200 and your code works fine in both instances. I can only surmise it's something to do with the fact that in the second example Progress knows what it is dealing with as you're working with an integer variable, whereas in the first situation it's having to keep the value in memory in a different way.
 
I do get error with the first code...But if i change the display to below by removing the 'OR'... there is no error, ( I'm on 10.2A, Windows 32 bit):

Code:
DEF VAR counter AS INTEGER NO-UNDO.
DEF VAR stringToCheck AS CHARACTER NO-UNDO INITIAL "".
 
DO counter = 1 TO 19244:
    stringToCheck = stringtoCheck + "Q".
END.

DISPLAY stringtoCheck = ?   length(stringToCheck) = 0.
 
However, that last check wouldn't ever be true. If the stringToCheck is ? then it's length will never be 0 (LENGTH will return ?, not 0 in that case).
 
Back
Top