Oracle 视图 EXCEPTIONS 官方解释,作用,如何使用详细说明
本站中文解释
Oracle 视图是Oracle系统表或者本地视图,该视图存放系统或用户定义的异常信息,用于记录错误提示信息、错误号和错误执行异常处理语句等。
使用方式:
1. 查看Exceptions视图里的数据:
SELECT * FROM EXCEPTIONS;
2. 创建异常处理:
DECLARE
my_exception EXCEPTION;
BEGIN
RAISE my_exception;
EXCEPTION
WHEN my_exception THEN
INSERT INTO EXCEPTIONS (ERROR_TEXT, ERROR_CODE) VALUES (‘Error encountered.’, -2000);
END;
/
官方英文解释
EXCEPTIONS
contains information on violations of integrity constraints. This table is created by the utlexcpt.sql
script.
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Row that caused the violation |
|
|
|
Owner of the table |
|
|
|
Name of the table |
|
|
|
Integrity constraint that was violated |