Specify the name of the table or view you want to update. You must name a table or view described in the CA Datacom Datadictionary, but not a CA Datacom Datadictionary table, a view of a CA Datacom Datadictionary table, or a read-only view.
You can specify a 1- to 18-byte correlation-name (correlation-name) to be used within the search-condition to designate the table or view. Also see Correlation Names and SQL Index Binding.
Introduces a list of column names and values.
Specify the names of the columns you want to update. The names must be separated by commas. You must name a column of the table or view you specified. Do not specify the name of the same column more than once and do not specify a column of any of the following types:
Tells the new value of the column. The expression cannot include a function. See Expressions for the expression's syntax diagram.
A column-name in an expression must name a column of the named table or view. For each row that is updated, the value of the column in the expression is the value of the column in the row before the row is updated. The following table shows a SET clause, the value of the columns in the row (before) and the resulting value (after) for each column:
|
SET clause |
Value of X Before |
Value of Y Before |
Value of X After |
Value of Y After |
|---|---|---|---|---|
|
SET X = 10, Y = X + 1 |
1 3 |
1 5 |
1 10 |
1 4 |
Use the NULL keyword to specify that the value for the column is to be set to a null value.
Introduces a condition that tells what rows are updated. You can omit the clause, give a search condition, or name a cursor. If you omit the clause, all rows of the table or view are updated.
The search-condition is applied to each row of the table or view and the updated rows are those for which the result of the search-condition is true. See Search Conditions for the search-condition syntax diagram.
Each column-name in the search condition must name a column of the table or view, and the table or view must not be referenced in the FROM clause of any subselect in the search condition.
If the search condition contains a subquery, the subquery can be thought of as being executed each time the search condition is applied to a row, and the results used in applying the search condition. In actuality, the subquery is executed for each row only if it contains a correlated reference to a column of the table or view.
Specify the name of a cursor that is defined in a DECLARE CURSOR statement of your program. The DECLARE CURSOR statement must appear in your program before the UPDATE statement.
The table or view named must also be named in the FROM clause of the SELECT statement of the cursor, and the result table of the cursor must not be read-only.
When the UPDATE statement is executed, the cursor must be positioned on a row. That row is the one that is updated.
|
Copyright © 2014 CA.
All rights reserved.
|
|