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

From: John Hurley <hurleyjohnb_at_yahoo.com>
Date: Thu, 17 Jun 2010 04:21:58 -0700 (PDT)
Message-ID: <c78c7554-a7cd-4ed9-92d4-7c94b0d1e410_at_z10g2000yqb.googlegroups.com>



Deb:

> 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.

We don't have any CLOBs but my guess is that you would use dbms_lob package. Isn't there a compare function or similar? Received on Thu Jun 17 2010 - 06:21:58 CDT

Original text of this message