Execute multi-step transaction
db_transactionRun multiple DML statements atomically: all succeed together or all roll back, ensuring data consistency for multi-step operations.
Instructions
Execute multiple DML statements (INSERT/UPDATE/DELETE) in a single atomic transaction.
All steps either succeed and commit together, or fail and roll back together. This ensures data consistency for multi-step operations.
Limits: 1-10 steps per transaction. Each step must use Oracle bind variables (:1, :2, ...) — never string interpolation.
Example: steps: [ { sql: "UPDATE accounts SET balance = balance - :1 WHERE id = :2", params: [100, 1] }, { sql: "UPDATE accounts SET balance = balance + :1 WHERE id = :2", params: [100, 2] }, { sql: "INSERT INTO transfers (from_id, to_id, amount) VALUES (:1, :2, :3)", params: [1, 2, 100] } ]
This is an atomic money transfer: either all three succeed or none do.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | Array of 1-10 DML steps to execute atomically. All succeed or all roll back. |