openGauss icon

openGauss

Get, add and update data in openGauss

Database → Update

AI-generated

Summary

Updates rows in an openGauss table where a specified column matches a value, using input data to set new values.

Inputs

  • schema (required) — The database schema containing the table.
  • table (required) — The table to update.
  • columnToMatchOn (required) — The column used to identify rows to update (usually an ID).
  • dataMode (required) — How to map input data to table columns ('autoMapInputData' or 'defineBelow').
  • options.outputColumns — Comma-separated list of columns to return; use '*' for all.

Output shape

Either a success object with affectedRows or the updated row data.

Returns updated rows if RETURNING is used; otherwise returns a success object. Empty result rows produce no output.

Examples

Example 1: Update a single record by ID.

Schema: public, Table: users, Column to Match On: id, Data Mode: autoMapInputData, Input Item: {"id": 1, "status": "active"}

Links

Discussion