Oracle study notes (1) --- PLSQL (1)

xiaoxiao2021-03-06  73

Today, the PL / SQL code written by others, finds a problem.

Simply said that there is a part of this function to achieve this: If the record has been recorded in the database table, there is no new record in INSERT. However, this code is implemented using Exception. If Update is unsuccessful, throw an exception to insert.

However, it is clear that Update does not throw an abnormality if the record does not exist, and the test is indeed nothing. NO_DATA_FOUND only when the SELECT statement is not returned to the data.

Here are a common Oracle error:

Wrong number

Abnormal error message name

Description

ORA-0001

DUP_VAL_ON_INDEX

Trying to destroy a uniqueness limit

ORA-0051

Timeout-on-resource

Timeouts occur when waiting for resources

ORA-0061

Transaction-backed-out

Due to death, death is revoked

ORA-1001

INVALID-CURSOR

Trying to use an invalid cursor

ORA-1012

NOT-logged-on

Not connected to Oracle

ORA-1017

Login-denied

Invalid username / password

ORA-1403

NO_DATA_FOND

SELECT INTO did not find data

ORA-1422

TOO_MANY_ROWS

SELECT INTO returns multiple lines

ORA-1476

ZERO-DIVIDE

Trying to be divided

ORA-1722

INVALID-NUMBER

Convert a number failure

ORA-6500

Storage-Error

Internal error in memory

ORA-6501

Program-error

internal error

ORA-6502

Value-error

Conversion or truncation error

ORA-6504

RowType-mismatch

The necrotal variable is not compatible with the PL / SQL variable.

ORA-6511

Cursor-already-open

Try to open an existing cursor

ORA-6530

Access-Into-Null

Try to assign a value for the attribute of the NULL object

ORA-6531

Collection-Is-Null

Try to apply a collection method other than EXISTS to a NULL PL / SQL table or on Varray

ORA-6532

Subscript-outside-limited

Reference to nest or varRay index exceeds a declaration

ORA-6533

Subscript-beyond-count

The number of nested or varRay indexes is quoted greater than the number of elements in the collection.

转载请注明原文地址:https://www.9cbs.com/read-120383.html

New Post(0)