Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: pass the row as a parameter from a trigger

Re: pass the row as a parameter from a trigger

From: sybrandb <sybrandb_at_gmail.com>
Date: 7 Feb 2007 01:47:23 -0800
Message-ID: <1170841643.331545.248440@v45g2000cwv.googlegroups.com>


On Feb 6, 9:46 pm, "prunoki" <hegyv..._at_ardents.hu> wrote:
> Hello,
>
> Is there an elegant, easy way of passing the :new values of the row
> from an each row trigger to a procedure? (10g) A trigger or a
> procedure the trigger calls cannot read data from its own table (table
> is mutating error) so I need to pass the values as a parameter and I
> am looking for an easy way to do it. Basically to handle the :new row
> as a record variable (like table%rowtype) and pass it, without typing
> everything again (:new.field1, :new.field2, ...).
>
> I can generate the sql with select statements from cols of course. Or
> I could create a global temp or PL/SQL table. Anything more elegant?
>
> Any ideas,
>
> Krisztian

Here is a small example

subtype r_client is "CLIENT"%rowtype;

procedure instrc(rec in out nocopy r_client);

This is from a package spec.

Works like a charm if you generate the procedure from [user|all|dba| _tab_columns, and if you generate a trigger in which you copy every individual column to a record of r_client. Hopefully you get the idea.

--
Sybrand Bakker
Senior Oracle DBA
Received on Wed Feb 07 2007 - 03:47:23 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US