DB2建立存储过程
DB2建立存储过程
---- add by liujx www.zzzyk.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