Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need to attempt running twice when PL/SQL was edited elsewhere

443806Jul 20 2005 — edited Jul 21 2005
I was wondering if someone could explain to me what is going on behind the scenes here. When I do this:

1. Run a package from SQLPLUS (say, out of Emacs) by saying something like:
begin
mypackage.setvar := 'apple';
mypackage.mymethod(setvar);
end;

2. Open, edit and save (i.e. also compile? Because errors are caught) the package body in another editor (say, VS.NET with Ora plug-in, or Toad or anything else)
3. Try running the package again from SQLPLUS by typing the same thing again.

It fails, and produces the following error for me.

ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package body "myschema.mypackage" has been invalidated
ORA-04065: not executed, altered or dropped package body "myschema.mypackage"
ORA-04061: existing state of package body "myschema.mypackage" has been invalidated
ORA-04065: not executed, altered or dropped package body "myschema.mypackage"
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at line 3

If I just repeat the command on SQLPLUS, it runs without a problem.

What is going on behind the scenes? Is it that one session's compilation(?) is not valid for another's? Any pointers would be greatly appreciated.

Thanks,

Srini
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2005
Added on Jul 20 2005
2 comments
569 views