Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: what about this?
> 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.htmlReceived on Thu Mar 06 2003 - 04:13:13 CST
![]() |
![]() |