UPDATE Statement

You can use an update statement to update a row in a table. It also supports updating multiple rows in a table that share the same shard key. You can find which columns in your table comprise of the shard key here, if you are running an On-Premises version of Oracle NoSQL.

Syntax

update_statement ::=
   UPDATE table_name [[AS] table_alias]
   update_clause ("," update_clause)*
   WHERE expression
   [returning_clause]

returning_clause ::= RETURNING select_list

For definitions of syntax components referenced in this statement, see:

Semantics

The update takes place at the server, eliminating the read-modify-write cycle, that is, the need to fetch the whole row at the client, compute new values for the targeted fields (potentially based on their current values) and then send the whole row back to the server.

Both syntactically and semantically, the update statement of the Oracle NoSQL Database is similar to the update statement of standard SQL, but with extensions to handle the richer data model of the Oracle NoSQL Database. So, as shown by the syntax above:

Note: While you can override the default limit, we do not recommend doing so for a large number of rows, as this can cause the update operation or the other read and write operations that affect the same data during the transaction to time out or experience higher latency.

The UPDATE statement is used to update the rows in the table. If you want to supply user-supplied metadata for the update operation, you can use the available QueryRequest API. For an example, see Using User-Supplied Metadata in Write Operations from Developers Guide.