Re: :old.clob and :new.clob in triggers

From: Timur Akhmadeev <timur.akhmadeev_at_gmail.com>
Date: Thu, 17 Jun 2010 09:06:53 -0700 (PDT)
Message-ID: <306a683a-ca16-41e3-8758-bb182345a461_at_w12g2000yqj.googlegroups.com>



On Jun 17, 12:58 pm, Deb <debashish.majum..._at_gmail.com> wrote:
> Hi,
>
> I've a table with a clob column. In a trigger that I need to write, I
> need to compare the old and new values for this column.
>
> The code inside the trigger body looks like this:
>
> CREATE OR REPLACE TRIGGER  tr_clob_test AFTER INSERT OR UPDATE OR
> DELETE
>    ON tbl_clob
>    REFERENCING NEW AS NEW OLD AS OLD
>    FOR EACH ROW
>
> IF UPDATING THEN
>         IF :NEW.clob_col <> :OLD.clob_col
>         THEN
>                 INSERT INTO ...
>         END IF;
> END IF;
> .....
>
> END;
> /
>
> Is this the right way of comparing the old and new values for a clob,
> inside the trigger? Please suggest.
>
> --
> Thanks
> DeB

Hi,

you can not write a trigger which will handle all kinds of updates to LOBs. For details refer to the documentation: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/create_trigger.htm#sthref1814.

Timur Akhmadeev Received on Thu Jun 17 2010 - 11:06:53 CDT

Original text of this message