发布网友 发布时间:2022-04-13 05:28
共1个回答
热心网友 时间:2022-04-13 06:57
--创建存储过程 IN_SHEETID 为输入参数CREATE OR REPLACE PROCEDURE ST_RECEIPT(IN_SHEETID VARCHAR2) ISBEGIN --将 receipt0表中数据插入 receipt INSERT INTO RECEIPT SELECT * FROM RECEIPT0 WHERE SHEETID = IN_SHEETID; --更新receipt表中Flag值 UPDATE RECEIPT SET FLAG = 100 WHERE SHEETID = IN_SHEETID; -- INSERT INTO RECEIPTITEM SELECT * FROM RECEIPTITEM0 WHERE SHEETID = IN_SHEETID; --删除ReceiptItem0表数据 DELETE FROM RECEIPTITEM0 WHERE SHEETID = IN_SHEETID; --删除 receipt0表数据 DELETE FROM RECEIPT0 WHERE SHEETID = IN_SHEETID;END;--调用存储过程BEGIN ST_RECEIPT('ys141128');END;--或者EXEC ST_RECEIPT('ys141128');