DB2建立存儲過程 ---- add by liujx www.2cto.com --初始化支付結果查詢'會計'字段 --刪除存儲過程 DROP PROCEDURE CMBBCD.UPDATE_CONDITION_VALUE(); --刪除key_為0的數據 DELETE FROM CMBBCD.CMCS3_CONDITION_LINE WHERE KEY_ = '0'; --創建存儲過程 CREATE PROCEDURE CMBBCD.UPDATE_CONDITION_VALUE () LANGUAGE SQL FOR EACH_RECORD AS SELECT ID_ FROM CMBBCD.CMCS3_CONDITION DO INSERT INTO CMBBCD.CMCS3_CONDITION_LINE VALUES (nextval FOR CMCS3_CONDITION_LINE_SEQ,id_,'0',CURRENT DATE,4,4,CURRENT DATE); END FOR; --調用存儲過程 CALL CMBBCD.UPDATE_CONDITION_VALUE(); ---- end