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 -> Re: what about this?

Re: what about this?

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Thu, 06 Mar 2003 08:38:53 -0800
Message-ID: <3E67799D.A3A89AED@exesolutions.com>


Rene Nyffenegger wrote:

> > Oracle9i Enterprise Edition Release 9.2.0.1.0 on
> > Tru64 UNIX V5.1A (Rev. 1885).
> >
> > create package test is
> > function user
> > return varchar2;
> > end test;
> > /
> >
> > create or replace
> > package body test is
> > function user
> > return varchar2
> > is
> > begin
> > return user;
> > end user;
> > end test;
> > /
> >
> > SQL> begin
> > 2 dbms_output.put_line(test.user);
> > 3 end;
> > 4 /
> > begin
> > *
> > ERROR at line 1:
> > ORA-00600: internal error code, arguments: [kohdtf048], [], [], [], [], [], [], []
> >
> > (I know this package would be of scarce utility, i was just trying...)
> > What do you think about this problem? Is this an Oracle bug?
>
> User is a reserved word and you named your function user.
>
> When you programmed the line 'return user' you did not, as you expected,
> return the name of the user, but call the function user again. And again.
> And again. until you hit ora-600.
>
> This works:
>
> create or replace package test is
> function user_ return varchar2;
> end test;
> /
>
> create or replace
> package body test is
> function user_ return varchar2
> is
> begin
> return user;
> end user_;
> end test;
> /
>
> begin
> dbms_output.put_line(test.user_);
> end;
> /
>
> hth
> Rene Nyffenegger
>
> --
> Projektleitung und Entwicklung in Oracle/C++/C# Projekten
> http://www.adp-gmbh.ch/cv.html

For future use:

SELECT *
FROM v_$reserved_words;

Daniel Morgan Received on Thu Mar 06 2003 - 10:38:53 CST

Original text of this message

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