Update records
db_updateUpdate records in an Oracle database table using parameterized named binds. Enforces a WHERE clause and limits affected rows to prevent accidental mass updates.
Instructions
Update one or more records in an Oracle database table using parameterized named binds.
Auto-generates the SET clause from the data object. The WHERE clause MUST include named bind variables (:w_1, :w_2, ...) with corresponding where_params.
Safety features:
WHERE clause is REQUIRED (updates without conditions are blocked)
Pre-counts matching rows and refuses if exceeding DML_MAX_ROWS (default: 1000)
dry_run mode previews SQL + affected row count
Example: table_name: "users" data: { "status": "active" } where: "id = :w_1" where_params: [42] dry_run: false
Args:
table_name, data, where, where_params, dry_run (default: false)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Column-value pairs to SET. Example: {"status": "active"} | |
| where | Yes | WHERE clause with named bind variables (:w_1, :w_2, ...). Example: 'id = :w_1 AND status = :w_2' | |
| dry_run | No | If true, return the generated SQL and affected row count without executing. | |
| table_name | Yes | Target table name | |
| where_params | Yes | Values for :w_1, :w_2, ... in order. Example: [42, 'inactive'] |