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: LOB with trigger

Re: LOB with trigger

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Sun, 26 Dec 2004 11:28:34 -0800
Message-ID: <41cf0fd9$1_3@127.0.0.1>


mm wrote:

> My question is about lobs within trigger.
> I have to create triggers on insert/update/delete on tables in order
> to perform specific auditing.
> For regular column type,it is ok.
> But for blob column type, i do not have a good lob locator in the :new
> variable.
>
> ex:
> create table bb (id number,name varchar2(10),obj blob);
> create table bbaudit(id number,action char(1),timest date,name
> varchar2(10),obj blob);
>
> create trigger TG_BB_UI
> BEFORE INSERT OR UPDATE on BB
> FOR EACH ROW
> DECLARE
> sAction CHAR(1);
> BEGIN
> IF INSERTING THEN
> sAction:='I';
> ELSIF UPDATING THEN
> sAction:='U';
> END IF;
> insert into bbaudit (ID,ACTION,TIMEST,NAME,OBJ)
> values (:new.id,sAction,sysdate,:new.name,:new.OBJ);
> END;
>
> According to Oracle, trigger does not support LOBs.
> In regular trigger :old reference can be read but not written AND :new
> reference cannot be read nor written.
>
> Someone does have an idea about how to resolve this restriction.

Have the trigger call a stored procedure.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Sun Dec 26 2004 - 13:28:34 CST

Original text of this message

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