# BULK INSERT TBD # DELETE Deletes rows from a ``. ``` ::= DELETE [ FROM ] [ WHERE ] ``` ## API ``` +$ delete $: %delete table=qualified-object predicate=(unit predicate) == ``` ## Arguments **``** The target of the `DELETE` operation. **``** Any valid ``, including predicates on CTEs. ## Remarks When `` is a ``, the command potentially mutates `
` resulting in a state change of the Obelisk agent. A stand-alone `DELETE` statement can only operate on a `
` and produces a `` of one command step. Data in the *sys* namespace cannot be deleted. When `` is a virtual table, the command produces an output `` which may be consumed as a pass-thru by a subsequent `` step. ## Produced Metadata @@ROWCOUNT returns the total number of rows deleted ## Exceptions `
` does not exist `GRANT` permission on `
` violated # INSERT Inserts rows into a ``. ``` ::= INSERT INTO [ ( [ ,...n ] ) ] { VALUES ( [ ,...n ] ) [ ...n ] | } ``` ``` ::= { | | | [ unary-operator ] expression | expression expression } ``` Details of `` are TBD. Refer to the Functions chapter currently under development. ## API ``` +$ insert $: %insert table=qualified-object columns=(unit (list @t)) values=insert-values == ``` ## Arguments **``** The target of the `INSERT` operation. **`` [ ,...n ]** When present, the column list must account for all column identifiers (names or aliases) in the target once. It determines the order in which update values are applied and the output ``'s column order. **(`` [ ,...n ] ) [ ,...n ]** Row(s) of literal values to insert into target. Source auras must match target columnwise. **``** Transform creating source `` to insert into target. Source auras must match target columnwise. ## Remarks When `` is a `
` the command potentially mutates `
`, resulting in a state change of the Obelisk agent. When `INSERT` operates on a `
`, it must be in the terminal (last) step of a `` or a stand-alone `INSERT`. Data in the *sys* namespace cannot be inserted into. When `` is a virtual table, the command produces an output `` which may be consumed as a pass-thru by a subsequent `` step. The `VALUES` or `` must provide data for all columns in the expected order. Cord values are represented in single quotes `'this is a cord'`. Single quotes within cord values must be escaped with double backslash as `'this is a cor\\'d'`. If `( [ ,...n ] )` is not specified, the inserted columns must be arranged in the same order as the target ``. When the target `` is a `
`, the input `` must match the `
` ``. When target `` is not a `
` and the input is from a `` then the target `` and `` `` must have the same all-column ``. New `` sub-types may be introduced. Note that multiple parentheses enclosed rows of column values are NOT comma separated. ## Produced Metadata `@@ROWCOUNT` returns the total number of rows inserted ## Exceptions `
` does not exist `GRANT` permission on `
` violated unique key violation colum misalignment # TRUNCATE TABLE Removes all rows in a base table. ``` ::= TRUNCATE TABLE [ ]
``` ## API ``` +$ truncate-table $: %truncate-table table=qualified-object == ``` ## Arguments **`
`** The target table. ## Remarks The command potentially mutates `
`, resulting in a state change of the Obelisk agent. Tables in the *sys* namespace cannot be truncated. ## Produced Metadata none ## Exceptions `
` does not exist `GRANT` permission on `
` violated # UPDATE Changes content of selected columns in existing rows of a ``. ``` ::= UPDATE [ ] SET { = } [ ,...n ] [ WHERE ] ``` ## API ``` +$ update $: %update table=qualified-object columns=(list @t) values=(list value-or-default) predicate=(unit predicate) == ``` ## Arguments **``** The target of the `UPDATE` operation. **`` = ``** `` is a column name or alias of a target column. `` is a valid expression within the statement context. **``** Any valid ``, including predicates on CTEs. ## Remarks When `` is a `
`, the command potentially mutates the data within `
`, resulting in a state change of the Obelisk agent. A stand-alone `UPDATE` statement can only operate on a `
`, producing a `` of one command step with no CTEs. Data in the *sys* namespace cannot be updated. When `` is a virtual table, the command produces an output `` which may be consumed as a pass-thru by a subsequent `` step. The `VALUES` or `` must provide data for all columns in the expected order. Cord values are represented in single quotes 'this is a cord'. Single quotes within cord values must be escaped with double backslash as `'this is a cor\\'d'`. ## Produced Metadata `@@ROWCOUNT` returns the total number of rows updated ## Exceptions `
` does not exist `GRANT` permission on `
` violated unique key violation aura mismatch on `SET`