Create a trigger in oracle to call stored procedures with Parameters

Source: Internet
Author: User

Oracle creation trigger call with parameters stored procedure Background: when inserting data into a data table, the defined stored procedure is called to parse the inserted data in xml format. The Stored Procedure contains parameters. solution: create a trigger for inserting data tables and call the Stored Procedure www.2cto.com in the trigger: see the previous blog article oracle to use the stored procedure to parse xml string insert statement: insert into t_xml (2, '<item> <cpu_name> name1 </cpu_name> <value> 80% </value> </item>') trigger creation: create or replace trigger TRG_t_PARSE before insert on t_xml referencing for each rowdeclare -- local variables here -- pragma autonomous_transaction; -- for autonomous transactions, subtransactions can have commitbegin p_parse (: new. id); -- call the stored procedure and pass the parameter: new. id -- commit; endTRG_t_PARSE;
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.