1 UPDATE Modifies a row in a table or view. 2 Environment You can use the UPDATE statement: o In interactive SQL o Embedded in host language programs to be precompiled o As part of a procedure in an SQL module o In dynamic SQL as a statement to be dynamically executed 2 Format (B)0UPDATE qwq> <table-name> qwqwqqqqqqqqqqqqqqqqqqqqqwqk   mq> <view-name> qqj m> <correlation-name> j x   lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj   mq> SET qw> <column-name> = qwq> value-expr qwqwqk   x tq> NULL qqqqqqqu x x  x mq> DEFAULT qqqqj x x  mqqqqqqqqqqqqqqq , WHERE qwq> predicate qwqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwj x   x m> optimize-clause qqqqqqqqqj x x   mq> CURRENT OF <cursor-name> qqqqqqqqqqqqqqqqj x   lqqqqqqqqqqqqqqqqqqqqqqqqq   mq> returning-clause qqj    (B)0optimize-clause =            qqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqq>   mq> OPTIMIZE qqwqwq> FOR qwq> FAST FIRST qqqqqqqqwqqqqqqqqqqwqwqj   x x tq> TOTAL TIME qqqqqqqqu   x x  x x mq> SEQUENTIAL ACCESS qj x x  x tq> USING <outline-name> qqqqqqqqqqqqqqqqqqu x  x tq> WITH qwq> DEFAULT qqwq> SELECTIVITY qu x x x tq> SAMPLED qqu x x x x mq> AGGRESSIVE j x x  x mq> AS <query-name> qqqqqqqqqqqqqqqqqqqqqqqj x   mqqqqqqqqqqqqqqqq   mq> RETURNING wq> value-expr wqj mq> INTO w> <parameter> wqj   mqqqqqq , UPDATE EMPLOYEES cont> SET ADDRESS_DATA_1 = '16 Ridge St.' cont> WHERE EMPLOYEE_ID = '00164'; 1 row updated SQL> SELECT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, ADDRESS_DATA_1 cont> FROM EMPLOYEES cont> WHERE EMPLOYEE_ID = '00164'; EMPLOYEE_ID FIRST_NAME LAST_NAME ADDRESS_DATA_1 00164 Alvin Toliver 16 Ridge St. 1 row selected Example 2: Using the UPDATE statement in a program The following example illustrates using a host language variable in an embedded SQL statement to update an employee's status code: DISPLAY "Enter employee's ID number: " WITH NO ADVANCING. ACCEPT ID. DISPLAY "Enter new status code: " WITH NO ADVANCING. ACCEPT STATUS-CODE. EXEC SQL DECLARE TRANSACTION READ WRITE END-EXEC EXEC SQL UPDATE EMPLOYEES SET STATUS_CODE = :STATUS-CODE WHERE EMPLOYEE_ID = :ID END-EXEC EXEC SQL COMMIT END-EXEC