UPDATE Syntax | SQL Statements | VantageCloud Lake - UPDATE Syntax (Basic Form, No FROM Clause) - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
{ UPDATE | UPD }

  table_name
  [ [AS] correlation_name ]
  SET set_spec [,...]
  [ WHERE condition | ALL ] [;]

Syntax Elements

table_name
Name of the base table, queue table, or derived table to be updated, or the name of a view through which the table is accessed.
correlation_name
An alias for table_name.
set_spec
column_name = expression
Names of one or more columns whose data is to be updated, and the expressions that are used for update.
WHERE
A conditional clause. For more information see WHERE Clause.
You can only specify a scalar UDF for search_condition if the UDF is invoked within an expression and returns a value expression.
If you specify a WHERE clause, you must have SELECT access on the searched objects.
condition
Conditional expression to be used for determining rows whose values are to be updated. The condition can reference multiple tables or specify a scalar subquery. See Scalar Subqueries in SELECT Statements and Rules for Using Scalar Subqueries in UPDATE Requests.
ALL
Indicates that all rows in the specified table are to be updated.
The ALL option is a Teradata extension to ANSI SQL.
column_name
Name of a column whose value is to be set to the value of the specified expression.
The column_name field is for a column name only.
Do not use fully-qualified column name forms such as databasename.tablename.columnname or tablename.columnname.
You cannot specify a derived period column name.
expression
An expression that produces the value for which column_name is to be updated.
expression can include constants, nulls (specified by the reserved word NULL), a DEFAULT function, or an arithmetic expression for calculating the new value. Values in a targeted row before the update can be referenced in an expression.
You can specify a scalar UDF for expression if the UDF returns a value expression.
For join updates, you can reference columns in expression from rows participating in the join.
A host variable in the SET clause must be preceded by a COLON character.