Adsense Ad

Thursday 25 May 2017

Oracle: ORA-00902 Error Message

ORA-00902 Error Message

Learn the cause and how to resolve the ORA-00902 error message in Oracle.

Description

When you encounter an ORA-00902 error, the following error message will appear:
  • ORA-00902: invalid datatype

Cause

You tried to execute a CREATE TABLE or ALTER TABLE statement that contained an invalid datatype.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

This error occurs when you try to execute a CREATE TABLE or ALTER TABLE statement that contains a datatype that does not exist. List of valid Oracle datatypes.
For example, if you tried to execute the following CREATE TABLE statement:
CREATE TABLE supplier
( supplier_id big_number,
  supplier_name varchar2(50)
);
Since big_number is not a valid datatype, you would receive the following error message:
Oracle PLSQL
You could correct this error as follows:
CREATE TABLE supplier
( supplier_id number,
  supplier_name varchar2(50)
);

No comments: