Informix Error -33071: The statement id statement_ID has already been used.
Cause and resolution
The statement id statement_ID has already been used.
This warning message indicates that you have used two PREPARE statement identifiers with the same name. For example:
exec sql prepare stmt_id from "select * from tab";
exec sql prepare stmt_id from "insert into tab values(1)";
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-33071 is a preprocessor warning — per the official guidance, it fires when two PREPARE
statements use the same statement-identifier name.
- Two
PREPAREstatements sharing the same statement identifier, per the official guidance — the direct, only cause.
Solutions / Resolution
- Use a distinct statement identifier for each
PREPARE, per the official guidance's implication.
Examples
Two PREPAREs sharing one statement ID
EXEC SQL PREPARE stmt_id FROM "SELECT * FROM tab";
EXEC SQL PREPARE stmt_id FROM "INSERT INTO tab VALUES(1)";
-- -33071: stmt_id reused for a second, unrelated PREPARE
Corrected
EXEC SQL PREPARE stmt_id FROM "SELECT * FROM tab";
EXEC SQL PREPARE stmt_id2 FROM "INSERT INTO tab VALUES(1)";
Diagnostic Checks
- Check for more than one
PREPAREusing the same statement identifier, and rename one.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -33071 in this set yet.
Two PREPARE statements reused the same statement identifier — give each a distinct
identifier.