How can the following DB2 example be re-coded to run under Datacom?
SELECT DOCU_TY, DOCU_NUM, DLR_TY, DLR_STUB, NUM_OF_PL, O_NUM_OF_PLFROM FINAL TABLE (UPDATE DLR_TO_REG_T206 INCLUDE (O_NUM_OF_PL CHAR (3)) SET NUM_OF_PL = '777', O_NUM_OF_PL = NUM_OF_PLWHERE DOCU_TY = 'NCD' AND DOCU_NUM = '00308N' AND DLR_STUB = 'DDD50' );
Release: All supported releases.
Component: SQL
Two separate Datacom SQL statements would be needed. First, and SQL UPDATE statement and then once it is finished, the SELECT statement.
There is no equivalent SQL statement for Datacom.
Note: This DB2 functionality came with DB2 9.0,
SELECT SUM(salary) INTO :SAL-HV FROM FINAL_TABLE (UPDATE EMP SET SALARY=SALARY*1.02 WHERE WORKDEPT='A01');
Prior to this capability, the UPDATE statement would have to run first, and then only after it finishes, could the SELECT be run to add up the new salary values. Now, instead of multiple statements requiring multiple passes through the data, it can be consolidated into one.