2 Replies Latest reply on Apr 12, 2013 9:31 PM by rp0428

    SQL Developer does not compile package body

    tx103108
      Linux OEL 6.3
      Oracle 11gR2
      -------------------

      create or replace package my_package
      as
      ....
      end my_package;
      /

      create or replace package body my_package
      as
      ....
      end my_package;
      /

      Problem: Package body does not compile using SQL Developer 3.1. The error was that on the package body the name my_package does not match MY_PACKAGE. However, it does compile using any other tool.
      Soln: To get the package body to compile, the following change was made -- see below (i.e. had to uppercase package body name):

      create or replace package my_package
      as
      ....
      end my_package;
      /

      create or replace package body MY_PACKAGE
      as
      ....
      end MY_PACKAGE;
      /

      can anyone explain why this would be so?

      Thanks.
        • 1. Re: SQL Developer does not compile package body
          Gary Graham-Oracle
          Hi,

          Very strange. I could not reproduce on Windows 7 64-bit or Oracle Linux Server 5.6 using 3.1 or 3.2.2. Uncertain if anything like this issue has been posted before. Here is my test case, run through worksheet or via the New Package editor (minus forward slashes):
          create or replace
          package globalvars as
            function showversion return varchar2;
          END globalvars;
          /
          
          create or replace
          package body globalvars as
            function showversion return varchar2 as
            begin
              return ('1.2.3');
            end showversion;
          end globalvars;
          /     
          Perhaps someone else will be able to reproduce the failure.

          You might try upgrading to the latest version without migrating the settings -- perhaps something got corrupted there.

          Thanks,
          Gary
          • 2. Re: SQL Developer does not compile package body
            rp0428
            >
            Problem: Package body does not compile using SQL Developer 3.1. The error was that on the package body the name my_package does not match MY_PACKAGE.
            >
            I don't see any error that you posted.

            You can't just say 'I got an error'. You need to post an EXACT copy of any exception and error message that you are getting.

            You also need to mention what database you are using and provide the full version number.

            The code you posted is not complete and will not compile. If you can reproduce the problem with a simple package post the entire DDL. Otherwise we can't try what you are doing to reproduce the problem.