Resolve ORA-00902 Error Message in Oracle

Learn the reason and how to unravel 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 happens when you try to execute a CREATE TABLE or ALTER TABLE statement that incorporates a datatype that does no longer exist. List of legitimate 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 now not a legitimate datatype, you would get hold of the following error message:

You could correct this error as follows:

CREATE TABLE supplier
( supplier_id number,
  supplier_name varchar2(50)
);