Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Execute Immediate With Renames Returning ORA-04068

Re: Execute Immediate With Renames Returning ORA-04068

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: Fri, 5 Aug 2005 07:46:01 +0100
Message-ID: <2mFpvkXpsw8CFwWC@jimsmith.demon.co.uk>


In message <1123202508.885055.75310_at_g14g2000cwa.googlegroups.com>, absinth <absinth_at_gmail.com> writes
>I have a procedure with the following code in the body of the function:
>
>EXECUTE IMMEDIATE 'TRUNCATE TABLE PREVIOUS';
>EXECUTE IMMEDIATE 'RENAME CX_DVA_PREVIOUS TO TEMP';
>EXECUTE IMMEDIATE 'RENAME CURRENT TO PREVIOUS';
>EXECUTE IMMEDIATE 'RENAME TEMP TO CURRENT';
>COMMIT;
>
>Basically what my procedure does is shuffle a current table to -->
>previous and clear out the current table.
>
>But executing this procedure in rapid succession gives me:
>SQL> exec interface.shuffle_current_table;
>
>PL/SQL procedure successfully completed.
>
>SQL> exec if_dva_inbound.shuffle_current_table;
>BEGIN interface.shuffle_current_table; END;
>
>*
>ERROR at line 1:
>ORA-04068: existing state of packages has been discarded
>ORA-04061: existing state of package body "INTERFACE.INBOUND" has been
>invalidated
>ORA-06508: PL/SQL: could not find program unit being called
>ORA-06512: at line 1
>

The procedure seems to be part of a package which references the tables you are messing about with. If so, then I suspect that as soon as you rename a table the package will be invalidated. You may need to move this into another package or make it a standalone.

-- 
Jim Smith
Because of their persistent net abuse, I ignore mail from
these domains (among others) .yahoo.com .hotmail.com .kr .cn .tw
For an explanation see <http://www.jimsmith.demon.co.uk/spam>
Received on Fri Aug 05 2005 - 01:46:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US