Create a trigger in Oracle to call stored procedures with Parameters

Source: Internet
Author: User
Background: when inserting data into a data table, a defined stored procedure is called to parse the inserted data in xml format. The Stored Procedure contains parameters. Solution: Create a trigger for inserting a data table.

Background: when inserting data into a data table, a defined stored procedure is called to parse the inserted data in xml format. The Stored Procedure contains parameters. Solution: Create a trigger for inserting a data table.

Background: when inserting data into a data table, a defined stored procedure is called to parse the inserted data in xml format. The stored procedure includes parameters,

Solution: Create a trigger for inserting data tables and call the stored procedure in the trigger.

Stored Procedure: see the previous article Oracle parsing xml strings using Stored Procedures

Insert statement: insert into t_xml (2 ,' Name1 80% ')

Trigger creation:

Create or replace trigger TRG_t_PARSE

Before insert on t_xml

Referencing

For each row

Declare

-- Local variables here

-- Pragma autonomous_transaction; -- an autonomous transaction that can have a commit

Begin

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.