1

I am recently facing issue "Program Unit being called" when calling another package/procedure with in our package.

Whenever we change anything in the child or parent package and execute the parent package it shows the error "Could not find program unit called" when calling the child package.

Venkatesh
  • 11
  • 4
  • You should provide a [mcve]. If this isn't about programmatic SQL development, maybe research over on https://dba.stackexchange.com/ –  Sep 18 '18 at 17:54
  • @jdv as the question is about writing PL/SQL packages clearly it is a programming question and so in scope for here. – APC Sep 18 '18 at 18:06
  • @APC my comment is an `if` statement. Just follow the correct branch. The compiler doesn't care if the other branch is never visited. –  Sep 18 '18 at 18:07
  • @jdv - I think that part of your comment is unhelpful and confusing to a new contributor. – APC Sep 18 '18 at 18:08
  • @APC I disagree. I'm asking the OP to take control of this question. It is either missing information, or in the wrong place, or _both_. They can use that information as they see fit. It is not up to a 5s review to know every tag meaning. It is enough to nudge folks in the right direction. I was not misleading in the least. –  Sep 18 '18 at 18:10
  • @Venkatesh - You're getting an ORA-06508 error message. Are you also getting `ORA-04068: existing state of packages has been discarded`? – APC Sep 18 '18 at 18:11
  • You can find a better explanation here https://stackoverflow.com/questions/19376440/ora-06508-pl-sql-could-not-find-program-unit-being-called – XING Sep 19 '18 at 04:55
  • No, I am not seeing ORA-04068 Error – Venkatesh Sep 19 '18 at 14:13

2 Answers2

0

Verify that the names of the called packages are correct. Check the packages or other objects(functions, procedures) used, must be compiled without errors.

Iulian
  • 169
  • 3
0

Oracle compiles its code. It is not scripting language.

This has some interesting side effects that we don't always anticipate.

In my case (that brought me looking here) this occurred because I changed a text constant in a Package Definition, but did not recompile the body. When the body went to reference the constant, it had been deleted and a new one created in its place ... BUT IT WAS STILL LOOKING FOR THE OLD OBJECT

Likely if you are mysteriously getting this error message, it is because you reference an object that was recompiled. Recompile the object with the reference and it should correct.

Jefferey Cave
  • 2,507
  • 1
  • 27
  • 46