異定義異常就是那些在pl/sql中已經(jīng)定義好并給予了異常名稱的異常。它們?nèi)糠旁趐l/sql自帶的標(biāo)準(zhǔn)包中,這樣pl/sql程序員就無需再次定義。
Oracle中總共有如下21種標(biāo)準(zhǔn)預(yù)定義異常:
Oracle異常名稱
錯誤號
說明
DUP_VAL_ON_INDEX
ORA-00001
You tried to execute an INSERT or UPDATE statement that has created a duplicate value in a field restricted by a unique index.試圖破壞一個唯一性限制
TIMEOUT_ON_RESOURCE
ORA-00051
You were waiting for a resource and you timed out.在等待資源時發(fā)生超時
TRANSACTION_BACKED_OUT
ORA-00061
The remote portion of a transaction has rolled back.由于發(fā)生死鎖事務(wù)被撤消
INVALID_CURSOR
ORA-01001
You tried to reference a cursor that does not yet exist. This may have happened because you’ve executed a FETCH cursor or CLOSE cursor before OPENing the cursor.試圖使用一個未打開的游標(biāo)
NOT_LOGGED_ON
ORA-01012
You tried to execute a call to Oracle before logging in.沒有連接到ORACLE
LOGIN_DENIED
ORA-01017
You tried to log into Oracle with an invalid username/password combination.無效的用戶名/口令
NO_DATA_FOUND
ORA-01403
SELECT INTO沒有找到數(shù)據(jù)You tried one of the following:
You executed a SELECT INTO statement and no rows were returned.You referenced an uninitialized row in a table.You read past the end of file with the UTL_FILE package.
TOO_MANY_ROWS
ORA-01422
SELECT INTO 返回多行You tried to execute a SELECT INTO statement and more than one row was returned.
ZERO_DIVIDE
ORA-01476
試圖被零除You tried to divide a number by zero.
INVALID_NUMBER
ORA-01722
轉(zhuǎn)換一個數(shù)字失敗You tried to execute an SQL statement that tried to convert a string to a number, but it was unsuccessful.
STORAGE_ERROR
ORA-06500
內(nèi)存不夠或內(nèi)存被破壞引發(fā)的內(nèi)部錯誤You ran out of memory or memory was corrupted.
PROGRAM_ERROR
ORA-06501
內(nèi)部錯誤,需重新安裝數(shù)據(jù)字典視圖和pl/sql包This is a generic “Contact Oracle support” message because an internal problem was encountered.
VALUE_ERROR
ORA-06502
賦值操作,變量長度不足,觸發(fā)該異常You tried to perform an operation and there was a error on a conversion, truncation, or invalid constraining of numeric or character data.
ROWTYPE_MISMATCH
ORA-6504
宿主游標(biāo)變量與 PL/SQL變量有不兼容行類型
CURSOR_ALREADY_OPEN
ORA-06511
試圖打開一個已打開的游標(biāo)You tried to open a cursor that is already open.
ACCESS_INTO_NULL
ORA-6530
試圖為null 對象的屬性賦值
COLLECTION_IS_NULL
ORA-6531
試圖給沒有初始化的嵌套表變量或者Varry變量賦值
SUBSCRIPT_OUTSIDE_LIMIT
ORA-6532
對嵌套或varray索引使用了負(fù)數(shù)
SUBSCRIPT_BEYOND_COUNT
ORA-6533
對嵌套或varray索引的引用大于集合中元素的個數(shù)
本文出自:億恩科技【mszdt.com】
服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|