ITeye博客

Oracle PRAGMA EXCEPTION_INIT

reymont · 2010-08-31 09:53 · 数据库 · SQL · Oracle · Markdown

看书看到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.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。