Unable to save package defined in text file into the database

hsheehan

Member
I've done this repeatedly as long as I've used PL/SQL Developer but, in the last couple of days, I've noticed that when I thought I was compiling my changes to my source into my test database, it wasn't actually updating the database source. Needless to say, this resulted in much confusion on my part. :P

I know I've done this before, but I can't seem to think of anything that I may have done to stop this.

Can anyone tell me if there is a preference or something that I may have inadvertently set to turn this ability off?

Version: 6.0.5.931

Workflow:
  • File->Open->Program File
  • Browse to source, select it and press Open
  • Make change to source file in Program Window
  • Press Execute icon
  • Note that the information message at the bottom
    of the program menu states "Compiled
    successfully" and the botton colored bar
    changes from yellow to black.
  • Check the source of the package in the database
    by either querying user source or opening the
    object from the Browser window and note that
    the changes were not made.
 
first guesses:

- you are logged onto a different schema than you think

- there is a schema.pkg on the CREATE OR REPLACE line and it points to another schema
 
Thanks for the suggestions, but those are not it.

I've explored some more and I think I've determined the cause.

I noticed after my initial post that, when I opened the source file in the Program Window, the tab that usually shows the package name didn't; instead it showed a single question mark. So it seemed that the Program Window was unable to interpret the source in order to know what it was.

I looked at the source and noted that it had a rather large comment block at the beginning of the file. Through trial and error I determined that, for this source file, if the comment block exceeded 155 lines in length, then the package name became the ? and the code would not be compiled into the database. If I reduced the comment block size to 155 lines or less, then the package name was correctly reported in the tab and the code was compiled into the database.

I'm not sure if this limitation is based upon lines of code or the amount of text within the 155+ line comment header, but that seems to be what causes the problem.
 
I think that you are correct and have found the problem. It seems like PL/SQL Developer isn't recognizing that this is a package.

In the program window preference, there is an "Ignore unrecognized PL/SQL" that you can uncheck. It should try to compile it then.
 
If the comment block applies to the contents of the package, why not include the comments _in_ the package, i.e.

Code:
create or replace package my_package
--
-- Huge comment block
--
as
  ..etc.
In that way you also have the relevant comments/information in the database.
 
The comments are revision history and aren't really intended to be included with the source. I may consider moving them inside the package body since that avoids this problem. Thanks for the suggestion.
 
I think that maybe I wasn't clear. You need to DISABLE the Ignore unrecognized PL/SQL preference if you want the "?" tabs to compile.

I think Marco's solution is better though.
 
Back
Top