Multiple SELECT AND CONSUME statements can appear in a transaction when:
- The session mode is ANSI.
- The session mode is Teradata and the SELECT AND CONSUME statements appear between BEGIN TRANSACTION (BT) and END TRANSACTION (ET) statements.
A SELECT AND CONSUME statement can consume any rows inserted into a queue table within the same transaction.
When performing SELECT AND CONSUME statements:
- Perform SELECT AND CONSUME statements early in a transaction to avoid conflicts with other database resources.
- Perform one SELECT AND CONSUME statement per transaction, if possible.