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

Home -> Community -> Usenet -> c.d.o.server -> A pl/sql compiler bug?

A pl/sql compiler bug?

From: bmlam <bmlam_at_online.de>
Date: 2000/04/08
Message-ID: <38EF8234.86F1FDEE@online.de>#1/1

Please consider the following script(s):

create table test1 (
 region varchar2(10),
 month char(2),
 sale number
);

create or replace procedure test_proc1
is
 cursor v_cur is
  select region, sum(sale),
   month
  from test1
  group by region
 ;
begin
 for rec in v_cur loop
  null;
 end loop;
end;
/

exec test_proc1;

On my system, the script yields the following output:

SQL> @test

Table created.

Procedure created.

begin test_proc1; end;

*
ERROR at line 1:

ORA-00979: not a GROUP BY expression
ORA-06512: at "SYSTEM.TEST_PROC1", line 4
ORA-06512: at "SYSTEM.TEST_PROC1", line 10
ORA-06512: at line 1


The point is: the SELECT statement in the cursor definition is straightly incorrect because MONTH should appear in the GROUP BY clause but it did not. And the compiler did not catch this! Eventually at run time, the error is detected but this is really annoying bcos you normally assumed that syntactical error in (static) SQL statements should have been ironed out once the procedure is compiled.

Should I call this a PL/SQL compiler bug or am I missing something? Received on Sat Apr 08 2000 - 00:00:00 CDT

Original text of this message

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