Informix Error -1334
-1334 The 4GL program cannot allocate any more space for temporary
string storage.You should not see this message from a program that is compiled at a version later than Version 4.1; however, programs that are compiled by 4GL Version 4.1 and earlier must deal with this issue.
Temporary string storage is used while evaluating a character expression. It is allocated by a simple algorithm from a fixed-size buffer. Space in this buffer is not reclaimed until the last pending character expression is finished. Because most expressions complete immediately, the string buffer is normally emptied as fast as it is used.
However, when expressions involve function calls, expression evaluation is suspended during the function call. The buffer is not cleared until the function returns. For example, temporary space is used for the literal "###" and the result of the USING operator in the following statement:
LET charvar = numvar USING '###', myfunc()
These pending values remain in the string buffer for the duration of the call to myfunc(). If the aggregate total of all temporary character values that are used during the evaluation of myfunc() and its sub-functions exceeds the buffer size, this error occurs.
You can usually prevent the error by isolating function calls in separate statements, as in the following example:
LET charvar = myfunc() LET charvar = numvar USING '###', charvar clipped
The string buffer is free during the call to myfunc() in the first statement and free again as soon as the second statement completes.
The short form of a WHEN clause in a CASE statement also creates a suspended character expression. In the following example, temporary string storage is tied up throughout the calls to func_A() and func_B().
CASE charvar WHEN 'A' CALL func_A() WHEN 'B' CALL func_B() ...
The longer form of the WHEN clause does not do this because evaluation of the character expression is completed before the function call begins.
CASE WHEN charvar = 'A' CALL func_A() WHEN charvar = 'B' CALL func_B()
Finally, a known error in some versions of IBM Informix-4GL Version 4.1 causes a spurious error of this type when the WORDWRAP clause appears in a PRINT statement. If the error recurs, note all circumstances and contact IBM Informix Technical Support.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1334 is specific to 4GL programs compiled with Version 4.1 or earlier — per the official guidance, a fixed-size buffer used for temporary string storage while evaluating character expressions gets exhausted; the buffer can't be cleared until pending character expressions finish, which is especially problematic when an expression involves a function call that suspends evaluation partway through.
- A complex character expression involving one or more function calls, per the official guidance — the temporary buffer can't be freed mid-evaluation while a function call is pending.
- A 4GL program compiled with Version 4.1 or earlier, per the official guidance — this fixed-size buffer limitation is specific to that version range.
Solutions / Resolution
- Isolate function calls into separate statements, per the official guidance, to free the string buffer between them and prevent overflow.
Examples
Isolating a function call from a complex expression
LET v_temp = format_name(first_name, last_name);
LET v_result = v_temp || " - " || status_text;
-- rather than combining format_name(...) directly into a single larger expression
Diagnostic Checks
- Confirm the program was compiled with Version 4.1 or earlier, since this limitation is specific to that range.
- Identify the complex character expression involving function calls, and isolate the function calls into their own statements.
Related Errors / Related Topics
- -1211 — "Out of memory." A related 4GL memory error, about a temporary expression work area generally rather than string storage specifically.
- -1319 — "The 4GL program has run out of runtime data space memory." A related, broader 4GL memory-exhaustion error.
A fixed-size temporary string buffer (Version 4.1 and earlier) was exhausted by a complex character expression involving function calls — isolate the function calls into separate statements.