Home > Database > Mysql Tutorial > Oracle创建触发器调用含参数存储过程

Oracle创建触发器调用含参数存储过程

WBOY
Release: 2016-06-07 17:27:04
Original
1084 people have browsed it

背景:在向数据表中插入数据时调用已定义的存储过程,对插入数据进行xml解析,该存储过程含参数, 解决方法:为插入数据表建立触

背景:在向数据表中插入数据时调用已定义的存储过程,对插入数据进行xml解析,该存储过程含参数,

解决方法:为插入数据表建立触发器,在触发器中调用存储过程

存储过程:请参见上一篇文章  Oracle中使用存储过程解析xml字符串 

插入语句为: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;

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template