Home » SQL & PL/SQL » SQL & PL/SQL » Getting :NEW BLOB Value using AFTER INSERT Triggers
Getting :NEW BLOB Value using AFTER INSERT Triggers [message #382633] Fri, 23 January 2009 05:06 Go to next message
sibgat
Messages: 45
Registered: November 2006
Location: Chennai
Member

Hi All,

I am trying to insert the BLOB Value in a audit table,using AFTER INSERT TRIGGER On a existing table containing BLOB Values
Only NULL is getting inserted , the same thing is working fine with AFTER UPDATE on Table.
BLOB Contains, Binary Bits eg: 011010000100101001110

Below is our code


CREATE OR REPLACE TRIGGER NEW 
AFTER INSERT ON REP_USER_RESO FOR EACH ROW

DECLARE
iUSERresoid rep_user_reso.USER_RESO_ID%type;
iresoid rep_user_reso.RESO_ID%type;
iUserid rep_user_reso.USER_ID%type;
i  number(3);
val  number(3);
val1 varchar2(50);    
iSTATUS NUMBER(10);
iPermission blob;

BEGIN

iUSERRESOID := :NEW.USER_RESO_ID;
iRESOID := :NEW.RESO_ID ;
iUSERID := :NEW.USER_ID ;
iSTATUS := :NEW.STATUS; 
iPermission := :new.Permission;

i:=1;val:=0;

while i<=100
   LOOP
        val1 := utl_raw.cast_to_varchar2( dbms_lob.substr(iPermission,2, i))  ;
        
        insert into audittbl values(iPermission);
        
        val := val+1;
            if val1 = '01' then
                insert into ivusertemp values(val,iUSERresoid,iresoid,iUserid);
            end if;  
       i:=i+2;
    
   END LOOP;

END NEW;
/


Thanks in advance
Sibgat
Re: Getting :NEW BLOB Value using AFTER INSERT Triggers [message #382635 is a reply to message #382633] Fri, 23 January 2009 05:17 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Is data definitely being inserted into REP_USER_RESO?
Previous Topic: How to Implement IsNumeris Function using Oracle
Next Topic: Prompting user to input informatio
Goto Forum:
  


Current Time: Fri Dec 02 20:27:32 CST 2016

Total time taken to generate the page: 0.08088 seconds