In oracle 8i I have several packages containing procedures and functions. In most cases one of the procedures has the same name as the package.

When I move this oracle 9i (9.2.0.1) these packages cannot be compiled.

Example:

CREATE OR REPLACE PACKAGE TEST_STUFF as
PROCEDURE TEST_STUFF(ai_test_id IN number);
FUNCTION GET_TEST_STUFF(ai_test_id IN number)
RETURN varchar2;

END;
/

CREATE OR REPLACE PACKAGE BODY TEST_STUFF as
PROCEDURE TEST_STUFF(ai_test_id IN number)
IS
ls_stuff varchar2(100);

begin
select GET_TEST_STUFF(1)
into ls_stuff from dual;

end TEST_STUFF;

FUNCTION GET_TEST_STUFF(ai_test_id IN number)
RETURN varchar2
IS
v_ename VARCHAR2(50);
BEGIN

v_ename:='TEST STUFF';

RETURN(v_ename);

EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN(NULL);
END;

end TEST_STUFF;
/

If I change the procedure name to be something other than the package name the package compile cleanly. However, I don't really want to revisit all of my code and make these changes.

I have also found that if I change the reference to the function to be:

ls_stuff := GET_TEST_STUFF(1);

everything is fine. But again, I would have to revisit a lot of code.

Why is Oracle doing this and is there anyway around it?

Thanks,

Brent