在哪里可以找到预定义 Oracle pl/SQL 异常的完整列表?

发布于 2024-08-16 16:26:27 字数 783 浏览 7 评论 0原文

在哪里可以找到所有预定义 Oracle pl/SQL 异常的完整列表?

在此链接中我找到了此列表,是还有吗?

ACCESS_INTO_NULL    ORA-06530
CASE_NOT_FOUND  ORA-06592
COLLECTION_IS_NULL  ORA-06531
CURSOR_ALREADY_OPEN ORA-06511
DUP_VAL_ON_INDEX    ORA-00001
INVALID_CURSOR  ORA-01001
INVALID_NUMBER  ORA-01722
LOGIN_DENIED    ORA-01017
NO_DATA_FOUND   ORA-01403
NOT_LOGGED_ON   ORA-01012
PROGRAM_ERROR   ORA-06501
ROWTYPE_MISMATCH    ORA-06504
SELF_IS_NULL    ORA-30625
STORAGE_ERROR   ORA-06500
SUBSCRIPT_BEYOND_COUNT  ORA-06533
SUBSCRIPT_OUTSIDE_LIMIT ORA-06532
SYS_INVALID_ROWID   ORA-01410
TIMEOUT_ON_RESOURCE ORA-00051
TOO_MANY_ROWS   ORA-01422
VALUE_ERROR ORA-06502
ZERO_DIVIDE ORA-01476

Where can I find a full list of all predefined Oracle pl/SQL Exceptions?

In this link i found this list, are there anymore?

ACCESS_INTO_NULL    ORA-06530
CASE_NOT_FOUND  ORA-06592
COLLECTION_IS_NULL  ORA-06531
CURSOR_ALREADY_OPEN ORA-06511
DUP_VAL_ON_INDEX    ORA-00001
INVALID_CURSOR  ORA-01001
INVALID_NUMBER  ORA-01722
LOGIN_DENIED    ORA-01017
NO_DATA_FOUND   ORA-01403
NOT_LOGGED_ON   ORA-01012
PROGRAM_ERROR   ORA-06501
ROWTYPE_MISMATCH    ORA-06504
SELF_IS_NULL    ORA-30625
STORAGE_ERROR   ORA-06500
SUBSCRIPT_BEYOND_COUNT  ORA-06533
SUBSCRIPT_OUTSIDE_LIMIT ORA-06532
SYS_INVALID_ROWID   ORA-01410
TIMEOUT_ON_RESOURCE ORA-00051
TOO_MANY_ROWS   ORA-01422
VALUE_ERROR ORA-06502
ZERO_DIVIDE ORA-01476

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

且行且努力 2024-08-23 16:26:27

这些是针对 11gr2 的,快速扫描后发现它们仍然相同:
http://download.oracle.com/docs/cd /E11882_01/appdev.112/e10472/errors.htm#BABHDGGG

这是来自 $ORACLE_HOME/rdbms/admin/stdspec.sql (egorius 标准包的优点是寻找答案的地方)

      /********** Predefined exceptions **********/

  CURSOR_ALREADY_OPEN exception;
    pragma EXCEPTION_INIT(CURSOR_ALREADY_OPEN, '-6511');

  DUP_VAL_ON_INDEX exception;
    pragma EXCEPTION_INIT(DUP_VAL_ON_INDEX, '-0001');

  TIMEOUT_ON_RESOURCE exception;
    pragma EXCEPTION_INIT(TIMEOUT_ON_RESOURCE, '-0051');

  INVALID_CURSOR exception;
    pragma EXCEPTION_INIT(INVALID_CURSOR, '-1001');

  NOT_LOGGED_ON exception;
    pragma EXCEPTION_INIT(NOT_LOGGED_ON, '-1012');

  LOGIN_DENIED exception;
    pragma EXCEPTION_INIT(LOGIN_DENIED, '-1017');

  NO_DATA_FOUND exception;
    pragma EXCEPTION_INIT(NO_DATA_FOUND, 100);

  ZERO_DIVIDE exception;
    pragma EXCEPTION_INIT(ZERO_DIVIDE, '-1476');

  INVALID_NUMBER exception;
    pragma EXCEPTION_INIT(INVALID_NUMBER, '-1722');

  TOO_MANY_ROWS exception;
    pragma EXCEPTION_INIT(TOO_MANY_ROWS, '-1422');

  STORAGE_ERROR exception;
    pragma EXCEPTION_INIT(STORAGE_ERROR, '-6500');

  PROGRAM_ERROR exception;
    pragma EXCEPTION_INIT(PROGRAM_ERROR, '-6501');

  VALUE_ERROR exception;
    pragma EXCEPTION_INIT(VALUE_ERROR, '-6502');

  ACCESS_INTO_NULL exception;
    pragma EXCEPTION_INIT(ACCESS_INTO_NULL, '-6530');

  COLLECTION_IS_NULL exception;
    pragma EXCEPTION_INIT(COLLECTION_IS_NULL , '-6531');

  SUBSCRIPT_OUTSIDE_LIMIT exception;
    pragma EXCEPTION_INIT(SUBSCRIPT_OUTSIDE_LIMIT,'-6532');

  SUBSCRIPT_BEYOND_COUNT exception;
    pragma EXCEPTION_INIT(SUBSCRIPT_BEYOND_COUNT ,'-6533');

  -- exception for ref cursors
  ROWTYPE_MISMATCH exception;
  pragma EXCEPTION_INIT(ROWTYPE_MISMATCH, '-6504');

  SYS_INVALID_ROWID  EXCEPTION;
  PRAGMA EXCEPTION_INIT(SYS_INVALID_ROWID, '-1410');

  -- The object instance i.e. SELF is null
  SELF_IS_NULL exception;
    pragma EXCEPTION_INIT(SELF_IS_NULL, '-30625');

  CASE_NOT_FOUND exception;
    pragma EXCEPTION_INIT(CASE_NOT_FOUND, '-6592');

  -- Added for USERENV enhancement, bug 1622213.
  USERENV_COMMITSCN_ERROR exception;
    pragma EXCEPTION_INIT(USERENV_COMMITSCN_ERROR, '-1725');

  -- Parallel and pipelined support
  NO_DATA_NEEDED exception;
    pragma EXCEPTION_INIT(NO_DATA_NEEDED, '-6548');
  -- End of 8.2 parallel and pipelined support

  /********** Add new exceptions here **********/

These are for 11gr2, a quick scan says they are still the same:
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/errors.htm#BABHDGGG

This is from $ORACLE_HOME/rdbms/admin/stdspec.sql (good point from egorius standard package is the place to look for the answer)

      /********** Predefined exceptions **********/

  CURSOR_ALREADY_OPEN exception;
    pragma EXCEPTION_INIT(CURSOR_ALREADY_OPEN, '-6511');

  DUP_VAL_ON_INDEX exception;
    pragma EXCEPTION_INIT(DUP_VAL_ON_INDEX, '-0001');

  TIMEOUT_ON_RESOURCE exception;
    pragma EXCEPTION_INIT(TIMEOUT_ON_RESOURCE, '-0051');

  INVALID_CURSOR exception;
    pragma EXCEPTION_INIT(INVALID_CURSOR, '-1001');

  NOT_LOGGED_ON exception;
    pragma EXCEPTION_INIT(NOT_LOGGED_ON, '-1012');

  LOGIN_DENIED exception;
    pragma EXCEPTION_INIT(LOGIN_DENIED, '-1017');

  NO_DATA_FOUND exception;
    pragma EXCEPTION_INIT(NO_DATA_FOUND, 100);

  ZERO_DIVIDE exception;
    pragma EXCEPTION_INIT(ZERO_DIVIDE, '-1476');

  INVALID_NUMBER exception;
    pragma EXCEPTION_INIT(INVALID_NUMBER, '-1722');

  TOO_MANY_ROWS exception;
    pragma EXCEPTION_INIT(TOO_MANY_ROWS, '-1422');

  STORAGE_ERROR exception;
    pragma EXCEPTION_INIT(STORAGE_ERROR, '-6500');

  PROGRAM_ERROR exception;
    pragma EXCEPTION_INIT(PROGRAM_ERROR, '-6501');

  VALUE_ERROR exception;
    pragma EXCEPTION_INIT(VALUE_ERROR, '-6502');

  ACCESS_INTO_NULL exception;
    pragma EXCEPTION_INIT(ACCESS_INTO_NULL, '-6530');

  COLLECTION_IS_NULL exception;
    pragma EXCEPTION_INIT(COLLECTION_IS_NULL , '-6531');

  SUBSCRIPT_OUTSIDE_LIMIT exception;
    pragma EXCEPTION_INIT(SUBSCRIPT_OUTSIDE_LIMIT,'-6532');

  SUBSCRIPT_BEYOND_COUNT exception;
    pragma EXCEPTION_INIT(SUBSCRIPT_BEYOND_COUNT ,'-6533');

  -- exception for ref cursors
  ROWTYPE_MISMATCH exception;
  pragma EXCEPTION_INIT(ROWTYPE_MISMATCH, '-6504');

  SYS_INVALID_ROWID  EXCEPTION;
  PRAGMA EXCEPTION_INIT(SYS_INVALID_ROWID, '-1410');

  -- The object instance i.e. SELF is null
  SELF_IS_NULL exception;
    pragma EXCEPTION_INIT(SELF_IS_NULL, '-30625');

  CASE_NOT_FOUND exception;
    pragma EXCEPTION_INIT(CASE_NOT_FOUND, '-6592');

  -- Added for USERENV enhancement, bug 1622213.
  USERENV_COMMITSCN_ERROR exception;
    pragma EXCEPTION_INIT(USERENV_COMMITSCN_ERROR, '-1725');

  -- Parallel and pipelined support
  NO_DATA_NEEDED exception;
    pragma EXCEPTION_INIT(NO_DATA_NEEDED, '-6548');
  -- End of 8.2 parallel and pipelined support

  /********** Add new exceptions here **********/
我三岁 2024-08-23 16:26:27

预定义的异常在 SYS.STANDARD 包中声明,您一定会在那里找到它们。

在我的 9.2.0.7 上,我发现一个不在列表中:

USERENV_COMMITSCN_ERROR exception;
pragma EXCEPTION_INIT(USERENV_COMMITSCN_ERROR, '-1725');

Predefined exceptions are declared in package SYS.STANDARD, there you'll surely find them all.

On my 9.2.0.7 I found one not in the list:

USERENV_COMMITSCN_ERROR exception;
pragma EXCEPTION_INIT(USERENV_COMMITSCN_ERROR, '-1725');
滴情不沾 2024-08-23 16:26:27

除了您的问题之外:出现ORA-03135:连接丢失联系错误时出现的异常的名称是什么。我该如何处理?

解决方案是定义一个新的异常并将其与错误代码关联:

exception connection_error;
pragma exception_init(connection_error, -3135);

...

exception
    when connection_error then
        ...

http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14261/exceptioninit_pragma.htm

In addition to your question: what is the name of exception, risen when ORA-03135: connection lost contact error appears. How can I handle it?

The solution is to define a new exception and associate it with an error code:

exception connection_error;
pragma exception_init(connection_error, -3135);

...

exception
    when connection_error then
        ...

http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14261/exceptioninit_pragma.htm

本宫微胖 2024-08-23 16:26:27
No_data_found        ora-01403
too_many_rows        ora-1422
zero_divide          ora-1476
dup_val_on_index     ora-00001
invalid_cursor       ora-1001
cursor already_open  ora-06511
invalid_number       ora-01722
value_error          ora-06502
ACCESS_INTO_NULL     ORA-06530
CASE_NOT_FOUND       ORA-06592
COLLECTION_IS_NULL   ORA-06531
No_data_found        ora-01403
too_many_rows        ora-1422
zero_divide          ora-1476
dup_val_on_index     ora-00001
invalid_cursor       ora-1001
cursor already_open  ora-06511
invalid_number       ora-01722
value_error          ora-06502
ACCESS_INTO_NULL     ORA-06530
CASE_NOT_FOUND       ORA-06592
COLLECTION_IS_NULL   ORA-06531
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文