oracle中怎样创建存储过程 csdn
2个回答
2017-08-10
展开全部
oracle中怎样创建存储过程 csdn
--创建存储过程 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');
--创建存储过程 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');
2017-08-10
展开全部
获取32位UUID的存储函数: CREATE OR REPLACE FUNCTION get_uuid RETURN VARCHAR IS guid VARCHAR (32); BEGIN guid := lower(RAWTOHEX(sys_guid()));
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询