What is the correct way to compile PL/SQL Package?


I usually use either SQL Developer (from Oracle) or TOAD for writing and compiling PL/SQL code. Now I'm considering to switch to Datagrip completely. However, I have 2 questions/problems

  1. Compiling: In the context menu (right click on the package file) there are 2 action items "Execute" and "Run 'my_package.pkb". First, I tried "Run 'my_package.pkb' and it did not seem to do the job and the package was not compiled in the database. Using "Execute" starting with the "Create or replace package ..." statement does compile the package. So, what does the option "Run 'my_package.pkb' do? and how does it differ from the other option?
  2. Compiling Warning: Where do I see this information or how can I enable it? 

I would be very appreciated if someone can answer me. Thanks 


Is that what you need?


Hi Vasily, 

Yes, this is exactly the problem. Let me elaborate on it a bit. The "Run ... " option in the right click menu does compile the code but it does not show any error or warning at all. One then has to check the status of the package in the database browser and use the option Database Tools/Recompile as you showed to actually be able to see the compiler errors. I'm very surprised that such an elementary function is not implemented properly for the most popular database in the world. 

The current workaround for me is to point the cursor to the "CREATE OR REPLACE PACKAGE" statement at the beginning and use the option "Execute" instead. This will give you proper error messages and warning. 



Please sign in to leave a comment.