Toad World® Forums

Pkg compile


#1

Is there a difference between the compiler in the SQL Editor, and the Package Editor? If I run a Create or Replace Package… in SQL Editor, I get a certain error message. If I open the Package Editor and put in the exact same code and press ctrl-S to save it, I get a different error message. Does it matter where I compile the object?

Thanks.
-Charlie


#2

Hi Charlie,

For your example, the SQL Editor is only executing the DDL to create or replace a package…it doesn’t really “compile” the object per se (and therefore, the SQL Editor is only concerned about the DDL having the correct DDL syntax). In other words, if you have any pl-sql -related errors, they will not be thrown up. Instead, you will most likely encounter ORA errors (if you have misspelt “replace” etc etc)

On the other hand, the Stored Program Editor (the editor in NAV that you use to edit stored programs such as procedures, functions, packages etc) actually attempt to compile the object (as source code) so invalid PL-SQL code will result in PL-SQL error codes (such as PLS-00103 etc etc) being thrown up when you try to save the package. If you want to compile code in an editor, the Stored Program Editor is there for that purpose.

Hopefully this will answer your questions. Please let us know if you have any more enquires.

regards,

Bernard


#3

Got it. Makes sense.

Thanks.
-Charlie