Oracle Data types

      No Comments on Oracle Data types
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Buffer 0 Email -- Filament.io 0 Flares ×

Datatypes

Every constant and variable has a data type ,which specifies the storage format. It also specifies the constraints ad valid range of values.
We can generalize the different types as follows
scalar type :This type has no internal components.
composite :This type has internal components that can be manipulated individually.
reference :This type holds pointers, that designate other program items.

LOB :This type holds values called lob locators, that specify the location of large objects

Scalar type Subtypes Composite type Reference type LOB type
BINARY_INTEGER NATURAL RECORD
TABLE
VARRAY
REF CURSOR
REF object_Type
BFILE
BLOB
CLOB
NCLOB
POSITIVE
NATURALN
POSITIVEN
SIGNTYPE
PLS_INTEGER
NUMBER INT
INTEGER
SMALLINT
DEC
DECIMAL
NUMERIC
DOUBLE PRECISION
FLOAT
BINARY_DOUBLE
BINARY_FLOAT
CHAR CHARACTER
NCHAR
VARCHAR2 STRING
VARCHAR
NVARCHAR2
RAW
ROWID
UROWID
BOOLEAN
DATE

Data type defintion PL/SQL SQL
CHAR() 32,767 chars 2,000 chars
NCHAR() 32,767 bytes 2,000 bytes
LONG 32,760 bytes 2GB
VARCHAR2() 32,767 chars 4,000 chars
NVARCHAR2() 32,767 bytes 4,000 bytes
CHARACTER 2,000 chars 2,000 chars
STRING() 32,767 bytes N/A
VARCHAR 32,767 bytes N/A
Integer
BINARY_INTEGER
(same as PLS_INTEGER in 10g)
32 bit N/A
PLS_INTEGER 32 bit N/A
Floating Point
NUMBER 38 chars 38 chars
Fixed Point
NUMBER(,) 38 chars 38 chars
Non-negative Integers
NATURAL 32 bit N/A
POSITIVE 32 bit N/A
Not Nullable Non-negative Integers
NATURALN 32 bit N/A
POSITIVEN 32 bit N/A
Restricted
SIGNTYPE -1, 0, +1 N/A
Integers with up to 38 decimal digits
INT 38 38
INTEGER 38 38
SMALLINT 38 38
Fixed point numbers up to 38 decimal digits
DEC(,) 38 38
DECIMAL(,) 38 38
NUMERIC(,) 38 38
Floating point numbers up to 126 binary digits
DOUBLE PRECISION() 126 126
FLOAT() 126 126
REAL 63 bin.digits 63 bin.digits
Floating point numbers using native machine arithmetic
BINARY_DOUBLE 64 bit 64 bit
BINARY_FLOAT 32 bit 32 bit

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Buffer 0 Email -- Filament.io 0 Flares ×

Leave a Reply

Your email address will not be published. Required fields are marked *

Paged comment generated by AJAX Comment Page