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: My Trigger Question

Re: My Trigger Question

From: nomenclature <nom_at_tonal.net>
Date: Mon, 25 Sep 2000 09:50:30 +0100
Message-ID: <39CF11D6.C71A2E22@tonal.net>

ozi wrote:
>
> Hi Everyone,
>
> I have set up a trigger on a table which fires whenever a row is inserted.
> What I need to know is how do I obtain the new row which has been inserted
> as a WHOLE instead of just the individual attribute values (like you would
> get if you used :new and :old). I've looked everywhere but can't find the
> answer. There has got to be an easy solution. I'm loosing faith in ORACLE
> ingenuity rather quickly.
>
> I'll be very thankful if anyone can help
> Regards,
> Tom

You could create a datatype :

current _row your_table%rowtype

and then explicitly copying the data,

your_table.col1 := :new.col1;
your_table.col2 := :new.col2;

I suppose you could use a function to do this and that you want to do it on one line.
This way you'd need one function per table-trigger unless you did some dynamic SQL...

(I agree it's a pain that

current_row := :new

doesn't work - As I remember there are a couple of other places where collection methods don't work as one might expect/desire.) Received on Mon Sep 25 2000 - 03:50:30 CDT

Original text of this message

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