Informix Error -4419: The variable used in the CONSTRUCT statement must be a character variable.
Cause and resolution
The variable used in the CONSTRUCT statement must be a character variable.
The name following the word CONSTRUCT must be that of a variable defined as CHARACTER or VARCHAR. It ought to be a long variable, since the string it receives may be long. Check the spelling of the name. If it is as you intended, find and inspect the DEFINE statement to see why it is not a character type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4419 fires when CONSTRUCT's target variable isn't CHAR/VARCHAR — per the official
guidance, it should also be a long variable, since the constructed string may be long.
CONSTRUCT's target variable isn'tCHAR/VARCHAR, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check the spelling of the name, per the official guidance.
- If it's as intended, inspect the
DEFINEstatement to see why it isn't a character type, per the official guidance, and declare it with sufficient length.
Examples
CONSTRUCT on a non-character variable
DEFINE query_clause INTEGER
CONSTRUCT BY NAME query_clause ON order_id, order_date
-- -4419: query_clause must be CHAR/VARCHAR
Corrected
DEFINE query_clause CHAR(200)
CONSTRUCT BY NAME query_clause ON order_id, order_date
Diagnostic Checks
- Check the
DEFINEstatement ofCONSTRUCT's target variable, and confirm it'sCHAR/VARCHARwith sufficient length.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4419 in this set yet.
CONSTRUCT's target variable isn't CHAR/VARCHAR — check its declaration and give it
sufficient length.