Re: Compiling PL/SQL code without executing it

From: ddf <oratune_at_msn.com>
Date: Wed, 16 Jan 2013 07:56:12 -0800 (PST)
Message-ID: <c0459026-1079-41f3-8f10-118cb26df230_at_googlegroups.com>



On Friday, January 11, 2013 10:08:00 AM UTC-7, joel garry wrote:
> On Jan 10, 5:04 am, Nicolas Joyard <joyard.nico..._at_gmail.com> wrote:
>
> > Hello,
>
> >
>
> > I'm looking for a way to compile PL/SQL code without actually executing it. I'm generating PL/SQL files which are then executed using SQL*Plus, but I would like to prevent executing all the files when any of them has a compilation error.
>
> >
>
> > I thought about creating a temporary procedure for each file and then checking its compilation status, but isn't there a more straightforward way ?
>
> >
>
> > Thanks,
>
> >
>
> > Nicolas
>
>
>
> You could DBMS_UTILITY.COMPILE_SCHEMA
>
> http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_util.htm#i1002332
>
> and then check all_objects for invalid ones.
>
>
>
> Could you be a little more explicit about your requirement?
>
>
>
> jg
>
> --
>
> _at_home.com is bogus.
>
> http://www.forbes.com/sites/oracle/2013/01/11/why-oracle-ceo-larry-ellison-is-so-bullish-on-sun-hardware/

One can also check DBA_INVALID_OBJECTS for such errors. I haven't had time to actually work on this problem to see if there is a way to 'conditionally' compile all objects and exit should one fail compilation. I'll put that on my to-do list after my RMOUG Training Days presentation and my meeting with the Apress editor.

David Fitzjarrell Received on Wed Jan 16 2013 - 16:56:12 CET

Original text of this message