Informix Error -552: Blob host variables are disallowed in multi-statement prepares.
Cause and resolution
Blob host variables are disallowed in multi-statement prepares.
This EXECUTE statement executes a prepared list of multiple statements. One or more of the host variables supplied for the ? placeholders in the list is a locator structure for a TEXT or BYTE value. This action is not allowed. Statements that refer to TEXT or BYTE variables may be prepared and executed, but they must be single statements, not part of a multistatement list.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-552 fires when an ESQL/C program PREPAREs and EXECUTEs a list of multiple statements
together, and one of the ? placeholders in that list is bound to a TEXT/BYTE locator
variable — simple-large-object (BLOB) locators are only supported in single-statement
prepare/execute, not as part of a multi-statement batch.
- A multi-statement
PREPARE/EXECUTElist including a statement with aTEXT/BYTEplaceholder, per the official guidance — the direct, only cause. - Batched statements built generically (concatenating several parameterized statements for one round trip) without excluding the one statement that carries a BLOB parameter.
Solutions / Resolution
- Prepare and execute the statement with the
TEXT/BYTEplaceholder on its own, per the official guidance, separate from the multi-statement list. - Keep the remaining statements batched together if they don't involve BLOB host variables, and issue the BLOB-carrying statement as a single, separate prepare/execute.
Examples
The disallowed batch
EXEC SQL PREPARE multi_stmt FROM
"INSERT INTO orders (order_id, status) VALUES (?, ?); \
INSERT INTO order_notes (order_id, note) VALUES (?, ?)";
/* note is a TEXT column bound via a locator -- -552 */
Split out the BLOB statement
EXEC SQL PREPARE order_stmt FROM
"INSERT INTO orders (order_id, status) VALUES (?, ?)";
EXEC SQL EXECUTE order_stmt USING :order_id, :status;
EXEC SQL PREPARE note_stmt FROM
"INSERT INTO order_notes (order_id, note) VALUES (?, ?)";
EXEC SQL EXECUTE note_stmt USING :order_id, :note_locator;
Diagnostic Checks
- Identify which statement in the multi-statement list binds a
TEXT/BYTElocator variable to a placeholder, and split that one out.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -552 in this set yet.
BLOB locators require their own single-statement prepare/execute — split them out of any multi-statement batch.