Informix Error -8057: Only user variables of type CHARACTER may be subscripted or have lists in the LET statement.
Cause and resolution
Only user variables of type CHARACTER may be subscripted or have lists in the LET statement.
You can use a subscript (two numbers in square brackets, used to extract a substring of characters) with names of character variables only. In a LET statement, you can assign multiple strings, separated by commas, to a character variable only. Variables of other types can receive only single values.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-8057 fires when a subscript or comma-separated list is used with a non-CHARACTER
variable — per the official guidance.
- A subscript applied to a non-
CHARACTERvariable, per the official guidance — the first named case; subscripting extracts a substring, and only character variables support that. - A comma-separated list of values assigned to a non-
CHARACTERvariable in aLETstatement, per the official guidance — the second named case; other types can only receive single values.
Solutions / Resolution
- Only use subscripts or multi-value
LETlists onCHARACTERvariables, per the official guidance.
Examples
Subscripting a non-CHARACTER variable
DEFINE total INTEGER
LET total[1,3] = "abc"
-- -8057: subscripting only applies to CHARACTER variables
Diagnostic Checks
- Check the variable's declared type wherever a subscript or multi-value
LETlist is used, and confirm it'sCHARACTER.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -8057 in this set yet.
A subscript or multi-value LET list was used on a non-CHARACTER variable — only
CHARACTER variables support this.