dbms_warning的使用

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_warn.htm#i1001622

http://forums.oracle.com/forums/thread.jspa?threadID=625283

[@more@]

117 DBMS_WARNING

The DBMS_WARNING package provides a way to manipulate the behavior of PL/SQL warning messages, in particular by reading and changing the setting of the PLSQL_WARNINGS initialization parameter to control what kinds of warnings are suppressed, displayed, or treated as errors. This package provides the interface to query, modify and delete current system or session settings.

This chapter contains the following topics:


Using DBMS_WARNING


Security Model

Note that for all the following interfaces, if value of the scope parameter is SYSTEM, then the user must have ALTER SYSTEM privilege.


Summary of DBMS_WARNING Subprograms

Table 117-1 DBMS_WARNING Package Subprograms

SubprogramDescription

ADD_WARNING_SETTING_CAT Procedure

Modifies the current session or system warning settings of the warning_category previously supplied

ADD_WARNING_SETTING_NUM Procedure

Modifies the current session or system warning settings of the or warning_number previously supplied

GET_CATEGORY Function

Returns the category name, given the message number

GET_WARNING_SETTING_CAT Function

Returns the specific warning category in the session

GET_WARNING_SETTING_NUM Function

Returns the specific warning number in the session

GET_WARNING_SETTING_STRING Function

Returns the entire warning string for the current session

SET_WARNING_SETTING_STRING Procedure

Replaces previous settings with the new value


ADD_WARNING_SETTING_CAT Procedure

You can modify the current session's or system's warning settings with the value supplied. The value will be added to the existing parameter setting if the value for the warning_category or warning_value has not been set, or override the existing value. The effect of calling this function is same as adding the qualifier (ENABLE/DISABLE/ERROR) on the category specified to the end of the current session or system setting.

Syntax

DBMS_WARNING.ADD_WARNING_SETTING_CAT (
   warning_category    IN    VARCHAR2,
   warning_value       IN    VARCHAR2,
   scope               IN    VARCAHR2);

Parameters

Table 117-2 ADD_WARNING_SETTING_CAT Procedure Parameters

ParameterDescription

warning_category

Name of the category. Allowed values are ALL, INFORMATIONAL, SEVERE and PERFORMANCE.

warning_value

Value for the category. Allowed values are ENABLE, DISABLE, and ERROR.

scope

Specifies if the changes are being performed in the session context or the system context. Allowed values are SESSION or SYSTEM.

20091029 我使用的如下
select * from v$parameter where regexp_like(name,'*plsql*')
call dbms_warning.set_warning_setting_string('enable:all','system')
call dbms_warning.set_warning_setting_string('disable:all','system')
select dump(sysdate),dump(sysdate - 1) from dual
call dbMS_WARNING.ADD_WARNING_SETTING_NUM(7204,'DISABLE','system')
call dbMS_WARNING.ADD_WARNING_SETTING_NUM(7204,'ENABLE','system')
call dbMS_WARNING.ADD_WARNING_SETTING_NUM(7204,'ERROR','system')

select DBMS_WARNING.GET_WARNING_SETTING_NUM(7204) from dual
select DBMS_WARNING.GET_CATEGORY(7204) from dual
select DBMS_WARNING.GET_WARNING_SETTING_STRING from dual

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/450962/viewspace-1028267/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/450962/viewspace-1028267/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值