Compiling a Package that explicitly references itself gives an error

Roeland

Member³
PL/SQL Developer version 9.0.4.1644

Code:
create or replace package TEST_COMPILE is

  type t_Dual_Cursor is ref cursor return Dual%rowtype;

  procedure View_Dual (p_Cursor out t_Dual_Cursor);

end TEST_COMPILE;
/
create or replace package body TEST_COMPILE is

  procedure View_Dual (p_Cursor out t_Dual_Cursor) is
  begin
    open p_Cursor for
      select *
      from Dual;
  end View_Dual;

  procedure Test_Dual is
    c_Cursor t_Dual_Cursor;
  begin
    TEST_COMPILE.View_Dual (p_Cursor => c_Cursor);
  end Test_Dual;

end TEST_COMPILE;
/

Compiling this package gives errors in my version of PL/SQL Developer. This used to work without problems.

Remove the 'TEST_COMPILE' in procedure 'Test_Dual' and everything compiles as usual.

Kind regards,

Roeland
 
How are you executing this, and what errors do you get?

I get no errors simply running this in a command window. I also don't get any errors when opening a blank Program window and copying the specification and body to their respective tabs.
 
Hi Worker,

Thanks for checking this. Are you executing this with the same version of PL/SQL Developer (9.0.4.1644)?

I have this code saved in a File (Test_Compile.pck) and then opened in a Program window.

Editing: After reading your comments again I tried to copy and paste the package body in a "Command Window" and that compiled just fine?!?

When I'm compiling the Program Window I'm getting the following error in the package body:

Code:
Compilation errors for PACKAGE BODY #####.TEST_COMPILE

Error: PLS-00306: wrong number or types of arguments in call to 'VIEW_DUAL'
Line: 13
Text: TEST_COMPILE.View_Dual (p_Cursor => c_Cursor);

Error: PL/SQL: Statement ignored
Line: 13
Text: TEST_COMPILE.View_Dual (p_Cursor => c_Cursor);

My Environment:

Using
Home: OraClient11g_home1
DLL: D:\Oracle\product\11.2.0\client\bin\oci.dll
OCI: version 11.1
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0

Character Sets
Character size: 4 byte(s)
CharSetID: 873
NCharSetID: 2000
Unicode Support: True
NLS_LANG: DUTCH_BELGIUM.AL32UTF8
NLS_CHARACTERSET: AL32UTF8
NLS_NCHAR_CHARACTERSET: AL16UTF16
 
Last edited:
PL/SQL Developer version 9.0.4.1665

This bug is still annoying me, could it be fixed ASAP, plz?

Roeland
 
PL/SQL Developer version 9.0.6.1665

Safe compilation is checked.

Try to compile this package:

Code:
create or replace package TEST_COMPILE is

  type t_Dual_Cursor is ref cursor return Dual%rowtype;

  procedure View_Dual (p_Cursor out t_Dual_Cursor);

  procedure View_Dual (p_Cursor out t_Dual_Cursor,
                       p_Extra_Param in number);

end TEST_COMPILE;
/
create or replace package body TEST_COMPILE is

  procedure View_Dual (p_Cursor out t_Dual_Cursor) is
  begin
    open p_Cursor for
      select *
      from Dual;
  end View_Dual;

  procedure View_Dual (p_Cursor out t_Dual_Cursor,
                       p_Extra_Param in number) is
  begin
    open p_Cursor for
      select *
      from Dual;
  end View_Dual;

  procedure Test_Dual is
    c_Cursor t_Dual_Cursor;
  begin
    TEST_COMPILE.View_Dual (p_Cursor => c_Cursor);
  end Test_Dual;

end TEST_COMPILE;

So there's still a problem with overloaded methods.
 
That is indeed not right. We'll fix it. The workaround here is to change:

TEST_COMPILE.View_Dual (p_Cursor => c_Cursor);

to:

View_Dual (p_Cursor => c_Cursor);
 
Back
Top