Informix Error -478
-478 User must specify TYPE.
In the initial state, when you execute a SET DESCRIPTOR statement, you must specify TYPE as one of the fields to be set. Set the TYPE field in the SET DESCRIPTOR statement, and execute it again.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-478 fires when SET DESCRIPTOR is executed on a descriptor item in its initial (unset) state
without specifying TYPE as one of the fields being set — TYPE has to be established first,
before other fields like LENGTH (see -476) can be meaningfully layered on top of it.
- A
SET DESCRIPTORstatement setting other fields (e.g.LENGTH,DATA) without also settingTYPE, on an item that has no type established yet. - Statements issued out of order — attempting to refine an item's other attributes before its fundamental type has been declared.
Solutions / Resolution
- Set the
TYPEfield in theSET DESCRIPTORstatement, per the official guidance, and execute it again. - Establish
TYPEfirst for a given descriptor item, before or alongside any other fields being set on it, rather than assuming a default type applies.
Examples
Setting TYPE alongside other fields
SET DESCRIPTOR 'desc1' VALUE 1 TYPE = SQLCHAR, LENGTH = 50;
The disallowed omission
SET DESCRIPTOR 'desc1' VALUE 1 LENGTH = 50;
-- -478: TYPE must be specified, especially on an item in its
-- initial state
Diagnostic Checks
- Check whether
TYPEis included in the failingSET DESCRIPTORstatement. - Confirm whether the descriptor item is in its initial state, requiring
TYPEto be established before other fields.
Related Errors / Related Topics
- -476 — "The LENGTH field must be specified when the type is SQLCHAR." A related
SET DESCRIPTORfield-pairing rule — onceTYPEis set toSQLCHAR,LENGTHalso becomes required. - -474 — "Unknown field type." Another related X/Open descriptor-field restriction, about valid field type keywords generally.
TYPE has to be established on a descriptor item before other fields can be meaningfully set —
always include it, especially the first time a given item is configured.