Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PLS-00103: Encountered the symbol "" when expecting one of the following
Sybrand Bakker wrote:
> IIRC the keyword DECLARE is redundant in trigger bodies, as it is in
> procedure bodies.
> --
> Sybrand Bakker, Senior Oracle DBA
SQL*Plus: Release 10.1.0.3.0 - Production on Thu Feb 24 18:24:40 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> drop table t purge;
Table dropped.
SQL> CREATE TABLE t (testcol VARCHAR2(20));
Table created.
SQL> CREATE OR REPLACE TRIGGER statement_level
2 BEFORE UPDATE
3 ON t
4
5 DECLARE
6
7 x VARCHAR2(1);
8
9 BEGIN
10 x := 'A';
11 END statement_level;
12 /
Trigger created.
SQL> CREATE OR REPLACE TRIGGER statement_level
2 BEFORE UPDATE
3 ON t
4
5 --DECLARE
6
7 x VARCHAR2(1);
8
9 BEGIN
10 x := 'A';
11 END statement_level;
12 /
x VARCHAR2(1);
*
ERROR at line 7:
ORA-04079: invalid trigger specification
Redundant? Not at all. By the same token:
SQL> CREATE OR REPLACE PROCEDURE a IS
2
3 x VARCHAR2(1);
4
5 BEGIN
6 x := 'A';
7 END;
8 /
Procedure created.
SQL> CREATE OR REPLACE PROCEDURE a IS
2
3 DECLARE
4
5 x VARCHAR2(1);
6
7 BEGIN
8 x := 'A';
9 END;
10 /
Warning: Procedure created with compilation errors.
SQL> show err
Errors for PROCEDURE A:
LINE/COL ERROR
-------- ----------------------------------------------------------------- 3/1 PLS-00103: Encountered the symbol "DECLARE" when expecting oneof the following:
is also invalid.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Thu Feb 24 2005 - 20:28:22 CST