Update Operators

[This is preliminary documentation and subject to change.]

DBOP_delete
Remove rows from a table. Delete takes two inputs. The first required input is a DBOP_table_name node describing the table being updated. The second optional input is a table-valued expression representing the rows to be deleted. If the second input is not provided, then all rows of the table specified in the first input are deleted. The requirement as to whether the input table being updated must be a base table is provider-specific.
DBOP_update
Modify the values of one or more columns in rows from a table which satisfy a condition. Update takes two required inputs. The first required input is a table-valued expression describing the set of rows being updated. The second required input is a DBOP_set_list_anchor node containing the update expressions (e.g., SET A=A+1, B=B-5). The column names represented in the DBOP_set_list_elements must be unambiguous. That is, in cases where the tuples to be updated are defined by a join expression over multiple tables, and a column being updated appears in more than one table, the reference to the updated column must be fully qualified (DBOP_qualified_column_name). For example, the update statement
UPDATE A INNER JOIN B ON A.F1=B.F1 SET A.X = 1, B.Y = 2 WHERE A.Z =10
 

is represented by an update node whose first input is a subtree representing the expression

A INNER JOIN B ON A.F1=B.F1 AND A.Z = 10
 

and the second input is a DBOP_set_list_anchor containing two list elements for A.X = 1, and B.Y = 2. The requirement as to whether the input table being updated must be a base table is provider specific.

DBOP_insert
Add rows to a table, specifying three arguments. One required row_constructor or table_constructor. One required table, one required column_list. Number of elements of column_list must match number of values in the constructed row(s). Columns not listed in the column_list must have default values or be nullable. Requirements as to whether table input must be a base table are provider specific.