aiaiDBA

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

13718043309

010-86462881

PLS-00492: variable or constant initialization may not refer to functions declared in the same package

PLS-00492: variable or constant initialization may not refer to functions declared in the same package
Cause: If a package spec p declares a function f, that function may not be used in any variable declarations in that same package spec. This is because of a circular instantiation problem: in order to fully instantiate the package spec, the variable must be initialized. To initialize the variable, the function body code in the package body must be executed. That requires that the package body be instantiated. However, the package body cannot be instantiated until the package spec is fully instantiated.
Action: Remove the reference to the function from the variable initialization. A technique which often works is to move the variable initialization from the variable declaration (in the package spec) to the package body initialization block.

请先 登录 后评论

1 个回答

小智
PLS-00492:可变或常量初始化可能不指代在同一个包中声明的函数,
.原因:如果包spec p声明函数f,该函数可能不会用于同一包规范中的任何变量声明中。这是因为循环实例化问题:为了完全实例化包规范,必须初始化变量。要初始化变量,必须执行包体中的函数体代码。这要求实例化包体。但是,在包规范完全实例化之前,无法实例化包体。,
.操作:从变量初始化中删除对函数的引用。一种通常工作的技术是将变量初始化从包变量声明(在包规范中)移动到包体主体初始化块。,
.
请先 登录 后评论