UPDATE STOCKS. ORDER SET ORDERQTY = DEFAULT WHERE PRODNO = 240
[Figure: Updating data using a default value]
3.2.4 Specifying the current date and time in data to be updated
To specify the current date and time in data to be added, specify the appropriate keyword in the set clause instead of a
value. To specify the current date, specify CURRENT_DATE. To specify the current time, specify CURRENT_TIME. To
specify the current time-stamp, specify CURRENT_TIMESTAMP. An example of specifying the current time-stamp in
data to be updated is given below.
The example uses the TV_STOCK table, which consists of three columns: PROCESS_DATETIME, ITMNO, and
STOCKQTY. STOCKQTY at PROCESS_DATETIME is specified for STOCKQTY.
Example:
In this example, PROCESS_DATETIME is updated to the current date and time (October 14, 2000,
18:35:31) and STOCKQTY is updated to the value of host variable STOCKQTY.
PROCESS_DATETIME and STOCKQTY are updated for the data for ITMNO "212" in the TV_STOCK
table. The value "65" has been specified for host variable STOCKQTY.
32