Informix Error -549
-549 Column column-name in UNIQUE constraint is not a column in the table.
The column appears in the list of columns for a UNIQUE clause, but it is not one of the columns defined in this table. Check the spelling of all column names in this statement. If they are as you intend, then check the definition of the table. See the discussion of error -328 for a way to list all column names in a table.
Database servers after Version 5.01 do not use this error message.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-549 is documented as obsolete — database servers after Version 5.01 don't produce it, having
folded this case into the more general -537 ("Constraint column column-name not found in
table"). It's documented here for older platforms/archival reference: it fired when a UNIQUE
clause's column list named a column that isn't actually defined on the table.
- A misspelled column name in the
UNIQUEclause's column list — the direct, common cause on the platforms where this error still applies. - A column referenced that was dropped or renamed since the DDL was originally written.
Solutions / Resolution
- Check the spelling of all column names in the statement, per the official guidance.
- Check the table's actual current definition, per the official guidance's pointer to
-328's discussion of listing a table's columns, if the spelling looks correct:
SELECT colname FROM syscolumns WHERE tabid = (SELECT tabid FROM systables WHERE tabname = 'orders') ORDER BY colno; - On a current-version server, expect -537 instead for this same underlying condition — the resolution is identical either way.
Examples
A misspelled column name
CREATE TABLE orders (order_id INT, status CHAR(10), UNIQUE (order_idd));
-- -549 (older servers) / -537 (current servers): 'order_idd' -- the actual column is 'order_id'
Corrected
CREATE TABLE orders (order_id INT, status CHAR(10), UNIQUE (order_id));
Diagnostic Checks
- Query
syscolumnsfor the table's actual column names and compare against theUNIQUEclause's column list.
Related Errors / Related Topics
- -328 — referenced directly by -549's official text as the discussion of how to list a table's actual column names.
- -537 — "Constraint column column-name not found in table." The current, more general error that superseded -549 after Version 5.01.
Obsolete since Version 5.01 — on current servers this same condition surfaces as -537 instead.