`
weigang.gao
  • 浏览: 482422 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

PLS-00313: 'XXXXX' not declared in this scope

 
阅读更多

Package中私有的Procedure/Function(没在Package Specification声明)需要注意放置的位置

比如下面的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

分享到:
评论

相关推荐

    codeblocks中报错:'to_string' was not declared in this scope解决方案

    在Code::Blocks中遇到“'to_string' was not declared in this scope”的错误,通常是由于编译器版本过低或者没有包含正确的头文件所导致的。`std::to_string`是C++11标准引入的一个函数,用于将数字转换为字符串。...

    keil常见错误.pdf

    keil常见错误 main.c(35): warning: #128-D: ...initSpi.c(6): error: #268: declaration may not appear after executable statement in block main.c(31): warning: #223-D: function "initNvic" declared implicitly

    faac-1.28.diff

    faac报错mpeg4ip_win32.h:70:36: error:'_TRUNCATE' was not declared in this scope ret = vsnprintf_s(buffer, count, _TRUNCATE, format, ap); mpeg4ip_win32.h:70:57: error:'vsnprintf_s' was not declared ...

    aria2-1.34.0.tar.7z解决了github下载的原版文件在linux中make报错问题一共解决了两个问题

    --------bignum.h:34:25: error: ‘make_unique’ was not declared in this scope inline ulong() : buf_(make_unique[]>(dim)) {} --------------这个问题 以及一个是是关于 /* libc already has support */ ...

    keil错误集V1.0.pdf

    3. **错误#268: declaration may not appear after executable statement in block** 这个错误表明在执行语句(如函数调用、赋值等)之后尝试声明变量。在C语言中,变量声明必须位于代码块的开头。解决方法是将...

    适用于Ubuntu 20.04的opencv-3.3.1资源

    经过我的修改,解决了error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope、error: ‘AVFMT_RAWPICTURE’ was not declared in this scope、error: invalid conversion from ‘const char*’ to ...

    Keil的常见编译警告

    7. warning: #69-D:integer conversion resulted in truncation 这个警告信息表示整数转换导致数据截断。这种情况下,可能造成数据丢失,出现错误。解决方法是关于这种警告,应该详细考虑。确定转换都在预期的结果...

    ORACLE DBMS STATS ERROR

    - `PLS-00302: component 'IS_STATS_FROM_UPGRADE' must be declared` - `ORA-04063: package body "SYS.DBMS_REGISTRY_SYS" has errors` - `ORA-04063: package body "SYS.DBMS_STATS" has errors` 这些错误表明`...

    QT任务管理器

    QT任务管理器是一款基于QT框架开发的简易任务管理应用程序,旨在为编程初学者提供一个学习和借鉴的实例。QT是一个跨平台的C++图形用户界面应用程序开发框架,它提供了丰富的库函数和工具,使得开发者可以方便地创建...

    Lidar-Lite:C ++和python库,用于从Lidar-Lite传感器获取数据

    /src/lidar_lite.cpp:36:64: error: 'i2c_smbus_write_byte_data' was not declared in this scope 使用此命令安装i2c-dev : apt-get install libi2c-dev 我在此网站上找到了一个很棒的教程(使用我的图书馆!...

    c++出错对照表 英汉对照

    - **Error: ‘variable’ was not declared in this scope** - 错误:‘variable’ 在此作用域中未声明。 - 解释:这表示你试图访问一个未被定义的变量。确保在使用变量前已经正确声明它。 - **Error: no match ...

    高二英语模块七单词拼写专项测试练习.doc

    12. declared - 宣布:2007年8月26日,希腊政府宣布全国进入紧急状态,此前发生了森林火灾。 这些单词和短语都是高二英语学习中常见的,通过这样的专项测试,可以帮助学生加深记忆,提高词汇运用能力。同时,它们...

    eslint-plugin-typescript:ESLint的TypeScript插件

    此存储库已存档。 请参阅eslint-plugin-typescript 对ESLint的TypeScript支持。 (这仍处于初期阶段,因此请耐心等待。)以下自述文件适用于即将发布的1.0.0版本。 安装您首先需要安装 : $ npm i eslint --save-dev...

    ISO 2859-4:2020 Sampling procedures for inspection by attributes

    该标准的第四部分,即“Procedures for assessment of declared quality levels”,专注于评估声明的质量水平。属性检验通常涉及对产品或服务的特性进行二元判断,例如合格/不合格,存在/不存在等。 在质量管理和...

    TCLAP-1.1.0_ubuntu9_0_4

    I have fixed this bug below: ------------------------------------------ # In file included from ../include/tclap/...# ../include/tclap/MultiArg.h:103: error: ‘EOF’ was not declared in this scope

    Linux下替换memset函数

    在Linux操作系统中,`memset`是一个非常常用的C库函数,用于将一块内存区域填充为特定的字节值。它的原型如下: ```c void *memset(void *ptr, int value, size_t num); ``` 该函数接受三个参数:`ptr`指向要填充...

    example-libressl:示例项目如何使用oatpp-libressl子模块。 HTTPS异步服务器

    项目布局|- CMakeLists.txt // projects CMakeLists.txt|- src/| || |- controller/ // Folder containing Controller where all endpoints are declared| |- client/ // HTTP client is here. Used in "proxy" ...

    Maven3实战笔记04Maven的生命周期和插件

    ### Maven的生命周期和插件详解 #### Maven生命周期概述 Maven是一个项目管理和综合工具,它通过一系列预定义的任务和明确的构建生命周期来管理项目的构建、报告和文档。Maven的核心特性之一是其生命周期...

    c++Textbook

    For undergraduate students in Computer Science and Computer Programming courses or beginning programmers A solid foundation in the basics of C++ programming will allow readers to create efficient, ...

    20120926-Informatica_Hello_World_Program.rar

    Assigns a value to a user-defined workflow variable Note: The variable must have been declared in the workflow Variables tab

Global site tag (gtag.js) - Google Analytics