<tfoot id='srj1z'></tfoot>

    1. <small id='srj1z'></small><noframes id='srj1z'>

        <bdo id='srj1z'></bdo><ul id='srj1z'></ul>
      <i id='srj1z'><tr id='srj1z'><dt id='srj1z'><q id='srj1z'><span id='srj1z'><b id='srj1z'><form id='srj1z'><ins id='srj1z'></ins><ul id='srj1z'></ul><sub id='srj1z'></sub></form><legend id='srj1z'></legend><bdo id='srj1z'><pre id='srj1z'><center id='srj1z'></center></pre></bdo></b><th id='srj1z'></th></span></q></dt></tr></i><div id='srj1z'><tfoot id='srj1z'></tfoot><dl id='srj1z'><fieldset id='srj1z'></fieldset></dl></div>
      <legend id='srj1z'><style id='srj1z'><dir id='srj1z'><q id='srj1z'></q></dir></style></legend>
      1. ORA-06508: PL/SQL: 找不到被调用的程序单元

        时间:2023-09-18
        <legend id='UGnSZ'><style id='UGnSZ'><dir id='UGnSZ'><q id='UGnSZ'></q></dir></style></legend>
      2. <small id='UGnSZ'></small><noframes id='UGnSZ'>

          <tbody id='UGnSZ'></tbody>

                • <bdo id='UGnSZ'></bdo><ul id='UGnSZ'></ul>
                  <tfoot id='UGnSZ'></tfoot>
                  <i id='UGnSZ'><tr id='UGnSZ'><dt id='UGnSZ'><q id='UGnSZ'><span id='UGnSZ'><b id='UGnSZ'><form id='UGnSZ'><ins id='UGnSZ'></ins><ul id='UGnSZ'></ul><sub id='UGnSZ'></sub></form><legend id='UGnSZ'></legend><bdo id='UGnSZ'><pre id='UGnSZ'><center id='UGnSZ'></center></pre></bdo></b><th id='UGnSZ'></th></span></q></dt></tr></i><div id='UGnSZ'><tfoot id='UGnSZ'></tfoot><dl id='UGnSZ'><fieldset id='UGnSZ'></fieldset></dl></div>
                • 本文介绍了ORA-06508: PL/SQL: 找不到被调用的程序单元的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我使用的是 oracle 10g 和 toad 11.5.我正在尝试从匿名块调用 api.

                  I am using oracle 10g and toad 11.5. I am trying to call an api from an anonymous block.

                  如果我在添加dbms_output.put_line后重新编译api,然后尝试执行匿名块,它会显示错误:

                  If I recompile the api after adding dbms_output.put_line and then try to execute the anonymous block, it shows error as:

                  "ORA-06508: PL/SQL: could not find program unit being called".
                  

                  但是,如果我结束当前会话并打开一个新会话,则匿名块将执行而不会出错.

                  However if I end current session and open a new session, then the anonymous block will execute with out the error.

                  由于这个问题,我每次对 API 进行更改时都必须重新连接会话.如果可以通过在蟾蜍或数据库级别进行任何配置来解决此问题,任何人都可以提供帮助.

                  Due to this issue, i am made to reconnect the session everytime i make a change to API. Can anyone help if this issue can be resolved by making any configurations in toad or database level.

                  推荐答案

                  我怀疑您只是在报告堆栈中的最后一个错误,如下所示:

                  I suspect you're only reporting the last error in a stack like this:

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

                  如果是这样,那是因为您的包是有状态的:

                  If so, that's because your package is stateful:

                  一个包中的变量、常量和游标的值声明(在其规范或正文中)包含其 包状态.如果一个 PL/SQL 包至少声明了一个变量,常量,或游标,则包是有状态;否则,它是无状态.

                  The values of the variables, constants, and cursors that a package declares (in either its specification or body) comprise its package state. If a PL/SQL package declares at least one variable, constant, or cursor, then the package is stateful; otherwise, it is stateless.

                  重新编译时状态丢失:

                  如果实例化的有状态包的主体被重新编译(或者显式地,使用ALTER PACKAGE 语句",或隐式地),包中的子程序的下一次调用导致 Oracle 数据库丢弃现有的包状态并引发异常ORA-04068.

                  If the body of an instantiated, stateful package is recompiled (either explicitly, with the "ALTER PACKAGE Statement", or implicitly), the next invocation of a subprogram in the package causes Oracle Database to discard the existing package state and raise the exception ORA-04068.

                  PL/SQL 引发异常后,对包的引用导致Oracle 数据库重新实例化包,它重新初始化它...

                  After PL/SQL raises the exception, a reference to the package causes Oracle Database to re-instantiate the package, which re-initializes it...

                  如果您的包裹有状态,您就无法避免这种情况.我认为真正需要一个有状态的包是相当罕见的,所以你应该重新访问你在包中声明的任何东西,但在函数或过程之外,看看它是否真的需要在那个级别.不过,由于您使用的是 10g,这包括常量,而不仅仅是变量和游标.

                  You can't avoid this if your package has state. I think it's fairly rare to really need a package to be stateful though, so you should revisit anything you have declared in the package, but outside a function or procedure, to see if it's really needed at that level. Since you're on 10g though, that includes constants, not just variables and cursors.

                  但是引用文档中的最后一段意味着下次您在同一会话中引用该包时,您将不会收到错误并且它会正常工作(直到您再次重新编译).

                  But the last paragraph from the quoted documentation means that the next time you reference the package in the same session, you won't get the error and it will work as normal (until you recompile again).

                  这篇关于ORA-06508: PL/SQL: 找不到被调用的程序单元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:SQL 错误:ORA-00933:SQL 命令未正确结束 下一篇:在 sqlplus/Oracle 中将纪元转换为日期

                  相关文章

                  1. <small id='yfUjD'></small><noframes id='yfUjD'>

                  2. <tfoot id='yfUjD'></tfoot>
                  3. <legend id='yfUjD'><style id='yfUjD'><dir id='yfUjD'><q id='yfUjD'></q></dir></style></legend>
                  4. <i id='yfUjD'><tr id='yfUjD'><dt id='yfUjD'><q id='yfUjD'><span id='yfUjD'><b id='yfUjD'><form id='yfUjD'><ins id='yfUjD'></ins><ul id='yfUjD'></ul><sub id='yfUjD'></sub></form><legend id='yfUjD'></legend><bdo id='yfUjD'><pre id='yfUjD'><center id='yfUjD'></center></pre></bdo></b><th id='yfUjD'></th></span></q></dt></tr></i><div id='yfUjD'><tfoot id='yfUjD'></tfoot><dl id='yfUjD'><fieldset id='yfUjD'></fieldset></dl></div>

                      <bdo id='yfUjD'></bdo><ul id='yfUjD'></ul>