Oracle Error code____oracle

Source: Internet
Author: User
Tags error code

The standard SQLException provides a standardized information segment (SQLState) and a vendor-specific information segment (ErrorCode). As with most databases and their JDBC driver implementations, Oracle databases and JDBC drivers provide more detailed information about the problem through vendor-specific error codes than through SQLException vendor-Independent SQLState The component provides much more information.

An obvious example of an Oracle database and its JDBC driver that provides much richer detail via error code is SQLState 42000 (which usually indicates syntax errors or access issues). For a large number of different Oracle error codes for the Oracle JDBC driver, SQLException will return the same SQLState value (42000). Some Oracle error codes corresponding to the 42000 value of SQLState include 900 ("Invalid SQL statement"), 903 ("Invalid table name"), 904 ("Invalid identifier"), 911 ("Invalid character"), and 936 ("Missing expression"). It is also clear that any errors originating from the Oracle JDBC driver (contrary to the error from the Oracle database) do not have any corresponding SQLState. As these examples show, Oracle-specific error codes provide more detailed information about error conditions than are provided by vendor-independent SQLState.

It is sometimes important to distinguish between errors originating from Oracle databases and errors originating from Oracle JDBC drivers. For example, 903 ("Invalid table name") error code corresponds to an Oracle database error code ORA-00903. Conversely, the 17003 ("Invalid column index") error code corresponds to an Oracle JDBC driver error code ORA-17003. Both types of error codes (databases and JDBC drivers) are specific to Oracle (as indicated by the ora-prefix). Because the SQLState error code is not supplied for errors originating from the Oracle JDBC driver, you must use an Oracle-specific error code to differentiate between errors caused by the JDBC driver.

Some of the most common errors in JDBC accessing the Oracle database are listed in table 1 below. The example in the sample code and/or comment column shows the type of SQL statement that caused the error or additional comments about the specific error that is displayed on the row in the table.

Table 1

Error Mark Oracle error SQLState sample code and/or comments

Based on statement: SELECT ename SQL related error from EMP variant

"Uniqueness constraint" 1 2300 For example primary key violation

"Resource busy and specify nowait to get Resources"

54 61,000 only appears when the nowait is specified

"Invalid SQL statement"

900 42000 ename from EMP

"Invalid table name"

903 42000 SELECT ename from

"Invalid identifier"

904 42000 SELECT EmpName from emp

"Invalid character"

911 42000 SELECT ename from EMP;

"Missing Columns"

917 42000 omitting commas when you need commas to separate columns in an INSERT statement can be a reason.

"The FROM keyword was not found at the desired location"

923 42000 SELECT ename EMP

"Missing expression"

936 42000 SELECT from EMP

"Table or view does not exist"

942 42000 SELECT ename from Empp

"Cannot insert null value"

1400 23000 attempt to insert a null value into a column that contains a not NULL constraint

"Value is greater than specified precision for this column"

1438 22003 try to insert more digits than the column allows for precision

"Invalid number"

1722 42000 trying to perform numeric functions on characters

"Integrity constraint Failed"

2291 23000 attempt to insert a row containing a foreign key that does not match an existing primary key

"Value too large,"

12899 72000 attempts to insert a value that exceeds the allowable range of the column (for example, too many characters)

"Io Exception"

17002 no errors originating from the Oracle JDBC driver do not correspond to SQLState (NULL)

"Invalid column index"

17003 without

"Invalid column name"

17006 without

"Value Overflow"

17026 without

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.