PL/SQL error?

  • From: "William Wagman" <wjwagman@xxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 27 Nov 2007 13:04:41 -0800

Greetings,

Running Oracle 10.2.0.3.0 EE on RHEL4 on a two node RAC cluster we get
the error below on compiling the included PL/SQL trigger with SQL
Developer the database. I can't for the life of me see where/why the
code is 'unreachable' (see the **, that is where the error is reported).
We also tried a number of things such as placing the complex IF on line
line, etc.--no dice. Can someone help me out here.

Thanks.

  TRIGGER_MAILIDS_AFTER Compiled (with warnings)

  Project: /home/tom/.sqldeveloper/system/...
    TRIGGER MOTHRA.TRIGGER_MAILIDS_AFTER@mothra_production
      Warning(28,7): PLW-06002: Unreachable code

> CREATE OR REPLACE
> TRIGGER trigger_mailids_after
>   AFTER INSERT OR DELETE OR UPDATE
>   ON mailids
>   FOR EACH ROW
> DECLARE
>   v_op      mailid_ops.opcode%TYPE;
>   v_mailid  mailid_ops.mailid%TYPE;
>   v_logopn  BOOLEAN := FALSE;
> BEGIN
>   IF INSERTING THEN
>     v_op := 'A';
>     v_mailid := :NEW.mailid;
>     v_logopn := TRUE;
>   ELSIF UPDATING THEN
>     v_op := 'M';
>     v_mailid := :NEW.mailid;
>     IF         :NEW.mailid           <>     :OLD.mailid
>         OR NVL(:NEW.mailtype,' ')    <> NVL(:OLD.mailtype,' ')
>         OR NVL(:NEW.mailstatus,' ')  <> NVL(:OLD.mailstatus,' ')
>         OR NVL(:NEW.expand,' ')      <> NVL(:OLD.expand,' ')
>         OR NVL(:NEW.userpart,' ')    <> NVL(:OLD.userpart,' ')
>         OR NVL(:NEW.hostpart,' ')    <> NVL(:OLD.hostpart,' ')
>         OR NVL(:NEW.mailboxhost,' ') <> NVL(:OLD.mailboxhost,' ')
>         OR NVL(:NEW.servcode,' ')    <> NVL(:OLD.servcode,' ')
>         THEN
>       v_logopn := TRUE;
**>   END IF;
>   ELSIF DELETING THEN
>     v_op := 'D';
>     v_mailid := :OLD.mailid;
>     v_logopn := TRUE;
>   END IF;
>   IF v_logopn THEN
>     BEGIN
>       INSERT INTO mailid_ops (opnum, opcode, mailid)
>       VALUES (seq_mailid_ops.NEXTVAL, v_op, v_mailid);
>     EXCEPTION
>       WHEN OTHERS THEN NULL;
>     END;
>   END IF;
> END;

Bill Wagman
Univ. of California at Davis
IET Campus Data Center
wjwagman@xxxxxxxxxxx
(530) 754-6208
--
//www.freelists.org/webpage/oracle-l


Other related posts: