RE: PL/SQL error?

  • From: "Brady, Mark" <Mark.Brady@xxxxxxxxxxxxxxxxx>
  • To: <wjwagman@xxxxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 27 Nov 2007 19:13:17 -0500

It's just a warning though -- not an error; although, in your subject
you call it an error. If it is right or wrong, doesn't matter. If you're
happy with your code then forge ahead.

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of William Wagman
Sent: Tuesday, November 27, 2007 4:05 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: PL/SQL error?

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
>>> This e-mail and any attachments are confidential, may contain legal,
professional or other privileged information, and are intended solely for the
addressee.  If you are not the intended recipient, do not use the information
in this e-mail in any way, delete this e-mail and notify the sender. CEG-IP2
--
//www.freelists.org/webpage/oracle-l


Other related posts: