Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: What's wrong with this trigger?
I think below trigger can do work when inserting. but on updating, ":new.pic_id" in where statemnet is not fixed. thus nothing happen.
so you had better divide this trigger.
if inserting then
Helen <helen_kuo_at_us.sina.com>ÀÌ(°¡) ¾Æ·¡ ¸Þ½ÃÁö¸¦
news:8ncnfh$s2s$1_at_newsmaster.cc.columbia.edu¿¡ °Ô½ÃÇÏ¿´½À´Ï´Ù.
> I could create this trigger, but it didn't do what I wanted. Thanks for
your
> input.
>
> CREATE OR REPLACE TRIGGER pic_trg_aiur BEFORE INSERT OR UPDATE
> OF status_yn ON picture
> FOR EACH ROW
>
> BEGIN
> IF :new.status_yn = 'Y' THEN
> UPDATE picture
> SET pic_ob = empty_blob()
> WHERE pic_id = :new.pic_id;
> END IF;
> EXCEPTION
> ..
> END;
> /
>
> H
>
>
Received on Wed Aug 16 2000 - 00:06:49 CDT