作者:过客 | 来源:互联网 | 2014-06-09 01:10
oracle创建触发器调用含参数存储过程背景:在向数据表中插入数据时调用已定义的存储过程,对插入数据进行xml解析,该存储过程含参数,解决方法:为插入数据表建立触发器,在触发器中调用存储过程www.2cto.com...SyntaxHighlighter.all();
oracle创建触发器调用含参数存储过程
背景:在向数据表中插入数据时调用已定义的存储过程,对插入数据进行xml解析,该存储过程含参数,
解决方法:为插入数据表建立触发器,在触发器中调用存储过程
www.2cto.com
插入语句为:insert into t_xml(2, ‘- name180%
’)
触发器建立:
create or replace trigger TRG_t_PARSE
before insert on t_xml
referencing
for each row
declare
-- local variables here
--pragma autonomous_transaction;--自治事务,子事务可以有commit
begin
p_parse(:new.id); --调用存储过程,传参数:new.id
--commit;
endTRG_t_PARSE;