Informix Error -486
-486 Illegal data type found during data conversions.
The data type found in the system descriptor sqlvar entry is either invalid or uninitialized. You cannot use the GET DESCRIPTOR statement to get a value from an uninitialized sqlvar.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-486 fires when the data type in a system descriptor's sqlvar entry is invalid or was never
initialized — GET DESCRIPTOR can't retrieve values from a sqlvar entry that hasn't been
properly set up.
- A
GET DESCRIPTORattempted before the descriptor was populated — viaDESCRIBE, or explicitSET DESCRIPTORcalls establishing eachsqlvarentry's type. - Manual
sqlda/descriptor construction leaving asqlvarentry's type field unset — a client-programming bug similar in kind to-418's null-descriptor scenario, but here about an uninitialized field within an otherwise-present structure. - A descriptor entry corresponding to a column position that doesn't actually exist in the described statement, referenced out of bounds.
Solutions / Resolution
- Ensure the descriptor was properly populated before calling
GET DESCRIPTOR— viaDESCRIBEagainst a prepared statement, or explicitSET DESCRIPTORcalls for manually constructed descriptors. - Review manual
sqlda/descriptor construction code for anysqlvarentry with an unset or invalid type field. - Confirm the occurrence/position being accessed actually corresponds to a real column in the described statement.
Examples
Populating a descriptor via DESCRIBE before GET DESCRIPTOR
PREPARE stmt1 FROM 'SELECT * FROM orders WHERE order_id = ?';
DESCRIBE stmt1 USING SQL DESCRIPTOR 'desc1';
GET DESCRIPTOR 'desc1' VALUE 1 :col_type = TYPE;
-- desc1 was populated by DESCRIBE before this GET
The disallowed premature GET DESCRIPTOR
ALLOCATE DESCRIPTOR 'desc1' WITH MAX 10;
GET DESCRIPTOR 'desc1' VALUE 1 :col_type = TYPE;
-- -486: desc1's sqlvar entries were never populated
Diagnostic Checks
- Confirm
DESCRIBE(or explicitSET DESCRIPTORcalls) ran beforeGET DESCRIPTOR. - Check the specific occurrence/position being accessed against the actual number of populated columns.
Related Errors / Related Topics
- -418 — "NULL SQLDA descriptor or host variable list encountered." A related descriptor-
structure error, about the descriptor/list itself being null rather than an individual
sqlvarentry's type being uninitialized. - -473 — "The specified data type is not a X/Open standard type." A related descriptor type-code restriction, about an invalid X/Open type code rather than a missing/uninitialized one.
Populate the descriptor via DESCRIBE (or explicit SET DESCRIPTOR calls) before attempting to
GET DESCRIPTOR from it — an allocated but unpopulated descriptor has no valid type information
to retrieve.