Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Trigger to blob column in Oracle - Need Help

453552Jun 27 2011 — edited Aug 14 2011
Hi,

I need any help on Oracle Trigger
I have two table
- BIODATA_TABLE
- ADM_GALERY_PICTURE

All two table contain column SPIC_PICTURE2 that is blob column.

If the picture column update in table BIODATA_TABLE, i want it to update also in ADM_GALERY_PICTURE,
I have created the trigger to BIODATA_TABLE.

When i try to update the picture, the picture on the ADM_GALERY_PICTURE does not updated.

Below is my trigger, Please help me to correct it



CREATE OR REPLACE TRIGGER TRANSFER_PICTURE_TRIGGER
AFTER INSERT OR UPDATE
ON BIODATA_TABLE
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
tmpVar NUMBER;
BEGIN
tmpVar := 0;


IF UPDATING
THEN
UPDATE ADM_GALERY_PICTURE
SET SPIC_PICTURE2 = :NEW.SPIC_PICTURE2
WHERE ADM_GALERY_PICTURE.SPIC_BIODATA_ID = :NEW.SPIC_BIODATA_ID;

END IF;


EXCEPTION
WHEN OTHERS
THEN
-- Consider logging the error and then re-raise
RAISE;
END TRANSFER_PICTURE_TRIGGER;
/



thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2011
Added on Jun 27 2011
13 comments
1,883 views