PLS-00313: 'XXXXX' not declared in this scope
来源:互联网 发布:haproxy mysql 编辑:程序博客网 时间:2024/05/18 01:27
Package中私有的Procedure/Function(没在Package Specification声明)需要注意放置的位置
比如下面的Package,Procedure A 想要调用 Procedure B,
所以正确的写法是:
比如下面的Package,Procedure A 想要调用 Procedure B,
CREATE OR REPLACE PACKAGE AAAAA AUTHID CURRENT_USER AS PROCEDURE A;END AAAAA;
CREATE OR REPLACE PACKAGE BODY AAAAA AS PROCEDURE A IS BEGIN B; END; PROCEDURE B IS BEGIN dbms_output.put_line('In PROCEDURE B'); END ;END AAAAA;会报错:PLS-00313: 'B' not declared in this scope
原因: B不是Public的Procedure,如果A想调用B,那么B的定义必须放在A的前边。
PLS-00313: "string" not declared in this scope
Cause: There is no declaration for the given identifier within the scope of reference. The identifier might be misspelled, its declaration might be faulty, or the declaration might be placed incorrectly in the block structure.
Action: Check the spelling and declaration of the identifier. Also confirm that the declaration is placed correctly in the block structure.
所以正确的写法是:
CREATE OR REPLACE PACKAGE BODY AAAAA AS PROCEDURE B IS BEGIN dbms_output.put_line('In PROCEDURE B'); END ; PROCEDURE A IS BEGIN B; END; END AAAAA;或者,如果确实想把B放到后边,那么可以在前面声明下,这样后边不过谁调用,也不会报错,这也是一个很好的习惯。
CREATE OR REPLACE PACKAGE BODY AAAAA AS PROCEDURE B; PROCEDURE A IS BEGIN B; END; PROCEDURE B IS BEGIN dbms_output.put_line('In PROCEDURE B'); END ;END AAAAA;
Reference:http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:11471812249709
- PLS-00313: 'XXXXX' not declared in this scope
- ‘cout’ was not declared in this scope
- 'wxCHANGE_DIR' was not declared in this scope
- 'setenv' was not declared in this scope
- 'UINT64_C' was not declared in this scope
- ‘UINT64_C’ was not declared in this scope
- ‘close’ was not declared in this scope
- was not declared in this scope
- Connect was not declared in this scope
- 'XXX' was not declared in this scope
- getcwd was not declared in this scope
- nullptr was not declared in this scope
- ‘close’ was not declared in this scope
- '_fileno' was not declared in this scope
- ‘inet_pton’ was not declared in this scope
- ioctl'was not declared in this scope
- FIONBIO was not declared in this scope
- offsetof' was not declared in this scope
- ThinkPHP函数详解:C方法
- as3强制转换 as
- KMP算法模板
- 浅谈:Ext.data.JsonStore
- vim 括号匹配和各种跳转技巧
- PLS-00313: 'XXXXX' not declared in this scope
- 程序员应该养几条鱼
- shadow文件中密码的加密方式
- MySQL双主复制的主备数据一致性知多少
- CRUD 英文全称
- 计算机科学与技术系专业课程关系图
- 谨防加班猝死之十大建议 献给纯脑力工作者
- 日期转化
- Android launcher 的平滑和立体翻页效果