开发者

Differentiate between Oracle error and warning messages

开发者 https://www.devze.com 2023-01-07 05:57 出处:网络
I am wondering if there is a way to differentiate between warning messages and error messages in Oracle?Does a Warning message count as an exception?Are warning just errors?Is there a clear difference

I am wondering if there is a way to differentiate between warning messages and error messages in Oracle? Does a Warning message count as an exception? Are warning just errors? Is there a clear difference? And if so, is there a way to catch warning messages explicitly, or information messages?

Thanks for an开发者_如何转开发y advice.


Oracle itself doesn't raise warning or information messages, only exceptions for error messages. However it does have some information that you can interrogate in PL/SQL such as:

SQL%ROWCOUNT:

update emp
set sal = sal+1000
where depno = 10;

if sql%rowcount = 0 then
    -- no rows got updated
    ...

cursor%NOTFOUND:

loop
    fetch mycursor into myvar;
    exit when mycursor%notfound;
end loop;
0

精彩评论

暂无评论...
验证码 换一张
取 消