As far as I'm aware, using INSERT ... RETURNING should produce an error
("Invalid type of statement used in batch", 335545185 or isc_batch_type)
when you create the batch. Batch execution cannot be used with INSERT
... RETURNING because of the output row (or result set when using INSERT
... SELECT ... RETURNING on Firebird 5). The same applies for EXECUTE
BLOCK, because even without output parameters, it still effectively has
an output row, that output row just doesn't have any columns.
Batch execution only works for statements that are described as
isc_info_sql_stmt_insert, isc_info_sql_stmt_update,
isc_info_sql_stmt_delete, and maybe isc_info_sql_stmt_select_for_upd.
INSERT .. RETURNING is described as either
isc_info_sql_stmt_exec_procedure or (Firebird 5+ INSERT ... SELECT ...
RETURNING) isc_info_sql_stmt_select. EXECUTE BLOCK without output
parameters (or output parameters + no SUSPEND) is described as
isc_info_sql_stmt_exec_procedure.
Mark
--
Mark Rotteveel