Subject: Re: Invalid status after successful run of procedure
References: <>
Organization: InterAccess, Co. - Chicagoland's Full Service Internet Provider

Avinash Kumar ( wrote:
: Hello everybody,
: I have procedure, which gets invalid after a successful run
: i.e. desc procedure_name   --  shows status invalid.
: The procedure first drops an existing view and then immediately
: creates the view using dbms_sql and later uses the newly created
: view.
: The procedure runs fine, except that it gets invalid after successful
: run. Every object that it uses is still valid. Surprisingly,
: doing an  " alter procedure p_name compile " sets it fine again.
: Any suggestions why ?
: Thanks in advance,
: Avinash Kumar


What is happening is that while the procedure runs, it is dropping an
existing view. At that point, Oracle marks the procedure as invalid, since
it references the view that was dropped. Creating the view again does not
re-validate the procedure.

You should look at the DBA_DEPENDENCIES view for a list of all objects
that the procedure "depend" on. If any of these objects are dropped or
become invalid, then your stored procedure will also become invalid.

-Ari Kaplan
Independent Oracle DBA Consultant

<-> For 100+ Oracle tips, visit my Web Page:                      <->
<->                                                               <->
<->                                    <->
<->                                                               <->
<->             email:                    <->

Back to Ari Kaplan's Home Page .htm">Back to Ari Kaplan's Home Page