Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: My Trigger Question
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