Oracle PRAGMA EXCEPTION_INIT

来源:互联网 发布:c#冒泡排序的算法思路 编辑:程序博客网 时间:2024/05/16 05:39
看书看到pragma exception_init(e_integrity, -2291);
感到很难以理解

翻了一下oracle PLSQL_User_Guide_and_Reference

引用
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/07_errs.htm#917


原来有些oracle error是没有名字的,这些error可以通过pragma来在编译的时候将名字和具体错误链接

在PL/SQL中 pragma exception_init告诉编译器e_integrity是和oracle error 2291联系在一起的。

语法是

PRAGMA EXCEPTION_INIT(错误名, -错误号);


exception_name is the name of a previously declared exception and the number is a negative value corresponding to an ORA- error number.
原创粉丝点击