Informix Error -1376: SQL, database server, or program variable mismatch warning.
Cause and resolution
SQL, database server, or program variable mismatch warning.
The program set WHENEVER WARNING STOP, and a warning condition arose. If the statement that is involved is a DATABASE or CREATE DATABASE statement, the condition is that the database server opened the database. On any other statement, the condition is that a SELECT statement returned more values than there were program variables to contain them.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1376 fires when a program has WHENEVER WARNING STOP set and a warning condition
arises — per the official guidance, this warning covers two cases: a DATABASE/CREATE DATABASE statement opening a database, or a SELECT statement returning more values than the
program has variables to receive them.
- A
DATABASE/CREATE DATABASEstatement opening a database, per the official guidance — the specificDATABASE-statement case, similar in kind to -1374/-1375's split. - A
SELECTreturning more columns than the program supplied receiving variables for, per the official guidance's other named case.
Solutions / Resolution
- If triggered by
DATABASE/CREATE DATABASE, confirm the specific database-opening condition is expected. - If triggered by a
SELECT, add enough receiving variables to match the number of selected columns.
Examples
A SELECT with too few receiving variables
SELECT order_id, status, total INTO v_order_id, v_status FROM orders WHERE order_id = 1;
-- -1376: 3 selected columns, only 2 receiving variables
Corrected
SELECT order_id, status, total INTO v_order_id, v_status, v_total FROM orders WHERE order_id = 1;
Diagnostic Checks
- Identify which statement triggered the warning — a
DATABASE/CREATE DATABASEstatement, or aSELECTwith a column/variable count mismatch.
Related Errors / Related Topics
- -1374 — "SQL character truncation or transaction warning." A related
WHENEVER WARNING STOPwarning, sharing the same statement-type-dependent interpretation. - -1375 — "SQL NULL value in aggregate or mode ANSI database warning." Another related
WHENEVER WARNING STOPwarning, sharing the same statement-type-dependent interpretation.
Depends on which statement triggered it — a database-opening statement, or a SELECT with more
columns than receiving variables.