Informix Error -383
-383 Need to specify view column names in the view definition.
In this VIEW statement, you have not listed specific names for columns. That action is allowed when the SELECT statement selects only simple, named columns. However, the SELECT statement here selects one or more expressions. You must give names to these columns in a parenthesized list that follows the name of the view. Because you cannot give names for only some of the columns, you must list names for all.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-383 fires when a view's defining SELECT includes an expression (an aggregate, a computed
value, a concatenation, etc.) rather than a simple named column, and the CREATE VIEW statement
doesn't supply an explicit column-name list to give that expression's output a name. Every
column in the view needs a name one way or another — either inherited directly from a simple
column reference, or supplied explicitly for the whole view when any expression is present.
- A view's
SELECTcontaining an expression (e.g.price * quantity,COUNT(*), a concatenation) with no explicit column-name list onCREATE VIEWto name it. - Assuming only the expression columns need explicit names — the official guidance is clear that when an explicit list is used, all columns need a name in it, not just the expression-derived ones.
- A view defined without an
AS column_aliason the expression, and no view-level column list either — leaving the resulting column completely unnamed.
Solutions / Resolution
- Provide an explicit parenthesized column-name list after the view name, per the official
guidance, covering every column in the
SELECT— not just the ones derived from expressions. - Alternatively, alias the expression directly in the
SELECTwithAS alias_name, which gives it a name without requiring a view-level column list (as long as every other column also resolves to a name this way).
Examples
Using an explicit view-level column list
CREATE VIEW order_totals (order_id, line_total) AS
SELECT order_id, price * quantity FROM order_items;
Aliasing the expression directly instead
CREATE VIEW order_totals AS
SELECT order_id, price * quantity AS line_total FROM order_items;
The disallowed unnamed expression
CREATE VIEW order_totals AS
SELECT order_id, price * quantity FROM order_items;
-- -383: price * quantity has no name, and no view-level
-- column list was given either
Diagnostic Checks
- Check the view's defining
SELECTfor any expression (not a simple column reference) lacking anASalias. - If a view-level column list is used, confirm it covers every column, not just the expression-derived ones.
Related Errors / Related Topics
- -382 — "Same number of columns must be specified for view and select clause." A closely related view-column-naming restriction — both concern keeping the view's column list correctly aligned with its defining query.
Either alias every expression directly in the SELECT with AS, or supply a complete
view-level column-name list covering all columns — a partial list naming only some columns isn't
valid.