create or replace PROCEDURE st_receipt(p_sheetid varchar2(16))
AS
BEGIN
insert into receipt select * from receipt0 where sheetid=p_sheetid ; --将 receipt0表中数据插入 receipt
update receipt set Flag=100 wheresheetid=p_sheetid; --更新receipt表中Flag值
insert into ReceiptItem select * from ReceiptItem0 where sheetid=p_sheetid ;
delete from ReceiptItem0 where sheetid=p_sheetid ;--删除ReceiptItem0表数据
delete from receipt0 where sheetid=p_sheetid ; --删除 receipt0表数据
end ;
exec st_receipt('ys141128')