Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: PL/SQL error?

RE: PL/SQL error?

From: William Wagman <wjwagman_at_ucdavis.edu>
Date: Tue, 27 Nov 2007 16:20:34 -0800
Message-ID: <FE043305B38A0F448F3924429D650C2A0555CDD2@VEXBE2.ex.ad3.ucdavis.edu>


I got numerous suggestions...

Exchanging <> with != doesn't change the error.

Wrapping with a BEGIN ... END; doesn't change the error.

Moving one of the statements above the IF...END IF; to below it makes the error go away.

Go figure. I think it's a parsing bug. Case closed. :-)

Thanks for your help.

Bill Wagman
Univ. of California at Davis
IET Campus Data Center
wjwagman_at_ucdavis.edu
(530) 754-6208
-----Original Message-----
From: Jared Still [mailto:jkstill_at_gmail.com] Sent: Tuesday, November 27, 2007 4:17 PM To: William Wagman
Cc: oracle-l_at_freelists.org
Subject: Re: PL/SQL error?

On 11/27/07, Jared Still <jkstill_at_gmail.com> wrote:
>
> The posted trigger is for all of update, delete, insert.
> What happens if you remove INSERT and DELETE from the trigger?
>

Well, that wasn't it:

16:16:13 SQL>alter session set plsql_warnings = 'enable:all';

Session altered.

16:16:13 SQL>
16:16:13 SQL>create table my_table ( x integer);

Table created.

16:16:13 SQL>
16:16:13 SQL>CREATE OR REPLACE
16:16:13   2  TRIGGER my_table_trg
16:16:13   3    AFTER INSERT OR DELETE OR UPDATE
16:16:13   4    ON my_table
16:16:13   5    FOR EACH ROW
16:16:13   6  DECLARE
16:16:13   7          v integer;
16:16:13   8  BEGIN
16:16:13   9          IF INSERTING THEN
16:16:13  10                  v := 1;
16:16:13  11          ELSIF UPDATING THEN
16:16:13  12                  IF :NEW.x <> :OLD.x
16:16:13  13                  THEN
16:16:13  14                          v := 1;
16:16:13  15                  END IF;
16:16:13  16          ELSIF DELETING THEN
16:16:13  17                  v := 1;
16:16:13  18          END IF;
16:16:13  19  END;
16:16:13  20  /

Trigger created.

16:16:13 SQL>
16:16:13 SQL>show error
No errors.
16:16:13 SQL> Perhaps you could provide a reproducible test case?

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Nov 27 2007 - 18:20:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US