Oracle Datatypes

To store data in a database, an appropriate set of tables must first be created, with columns of the appropriate types defined. These are the basic Oracle datatypes we have to choose from:

String types 

CHAR(length)

Fixed-length character data: max limit, 2,000

VARCHAR2(length)

Variable-length string: max limit: 4,000
Numeric 

NUMBER

Float, 38-digit decimal significance: max scale, 127

NUMBER(precision)

Integer (fixed precision)

NUMBER(precision, scale)

Fixed point
Time and date 

DATE

Date and time Jan 1, 4712 BCE—Dec 31, 9999 CE; 1-second precision

TIMESTAMP

Extension of date—fractional seconds with 0- to 9-digit precision, default 6

There are a few other types, particularly BLOB (Binary Large Objects) and CLOB (Character Large Objects), ...

Get Java™ Oracle® Database Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.