aiaiDBA

加微信获取免费职业规划+学习资料,了解年薪50万的DBA是如何练成的

13718043309

010-86462881

PLS-00900: can't find body of unit 'string'

PLS-00900: can't find body of unit 'string'
Cause: At run time, the body of a program unit could not be found. This can happen for one of two reasons. -- First, there may be a unit 'a' which calls a module 'b', where the spec for 'b' exists but not the body. In this case, since the spec is present, there will be no compile-time errors. -- Secondly, this can occur if there is a reference to a sequence outside of the proper context such as a SQL statement. In this case, the "spec" of the sequence reference can be found, but it is invalid to actually run code which references the sequence outside a SQL statement, as in: i := seq.nextval;
Action: If caused by the first reason, create a body for the object that is being referenced. If caused by the second reason, move the sequence into a SQL statement. For example, i := seq.nextval; can be replaced by: select seq.nextval into temp from dual; i := temp;

请先 登录 后评论

1 个回答

小智
PLS-00900:找不到单位' string ',
.原因:在运行时,无法找到程序单元的主体。这可能是由于两个原因之一。 - 首先,可能会有一个单元'a',它调用一个模块'b',其中'b'的规范存在而不是主体。在这种情况下,由于存在规范,因此不会有编译时错误。 - 其次,如果存在对适当上下文之外的序列的引用,例如SQL语句,则可能会发生这种情况。在这种情况下,可以找到序列引用的“spec”,但实际运行引用SQL语句外的序列的代码无效,如:i:= seq.nextval;,
.操作:如果由于第一个原因导致,请为正在引用的对象创建一个主体。如果由于第二个原因引起的,将序列移动到SQL语句中。例如,i:= seq.nextval; 可以替换为:select seq.nextval into temp from dual; i:= temp;,
.
请先 登录 后评论