Built-in Data Type References

Aliases of Built-in Data Types

BINARY

Syntax

BINARY [ (length) ]

Syntax Rules and Parameters

Description

A fixed-length binary string is stored.
If the binary string length to be stored is shorter than the specified length,  X'00 ' is stored in the remaining part.
• Storage size: Bytes of the length value

For More Information

Refer to the followings.

BINARY VARYING

Syntax

BINARY VARYING (length)

Syntax Rules and Parameters

Description

The variable-length binary string is stored.

• Storage size: Bytes of the binary string to be stored
• Alias names: VARBINARY

For More Information

Refer to the followings.

BINARY LONG VARYING

Syntax

BINARY LONG VARYING

Description

The value of the long variable binary string is stored.
• Maximum storage size: 100 megabytes
• Storage size: Bytes of the binary string to be stored
• Alias names: LONG BINARY VARYING, LONG VARBINARY
It can not be used as a column of the key, so there are limitations as follows.
• It can not be used as a key column of an index.
• It can not be used as the expression of ORDER BY clause. 
• It can not be used as the expression of GROUP BY clause.
• It can not be used as the expression of DISTINCT clause.
• It can not be used as the expression of UNION, INTERSECT, EXCEPT clauses.

For More Information

Refer to the followings.

BOOLEAN

Syntax

BOOLEAN

Description

TRUE or FALSE is stored.
• Storage size: 1 byte.

CHARACTER

Syntax

CHARACTER [ (length [ CHARACTERS | OCTETS | CHAR | BYTE ] ) ]

Syntax Rules and Parameters

Description

A fixed-length string is stored.
If the length of the string to be stored is shorter than the specified length, white spaces are stored in the remaining part.

For More Information

Refer to the followings.

CHARACTER VARYING

Syntax

CHARACTER VARYING ( length [ CHARACTERS | OCTETS | CHAR | BYTE ] )

Syntax Rules and Parameters

Description

The variable-length string is stored.

• Storage size: Bytes of the string to be stored
• Alias names: VARCHAR, VARCHAR2

For More Information

Refer to the followings.

CHARACTER LONG VARYING

Syntax

CHARACTER LONG VARYING

Description

The value of the long variable-length string is stored.

• Maximum storage size: 100 megabytes
• Storage size: Bytes of the string to be stored 
• Alias names: LONG CHARACTER VARYING, LONG CHAR VARYING, LONG VARCHAR
It can not be used as a column of the key, so there are limitations as follows.

• It can not be used as a key column of an index.
• It can not be used as the expression of ORDER BY clause. 
• It can not be used as the expression of GROUP BY clause.
• It can not be used as the expression of DISTINCT clause.
• It can not be used as the expression of UNION, INTERSECT, EXCEPT clauses.

For More Information

Refer to the followings.

DATE

Syntax

DATE

Description

It is the date type including YEAR, MONTH, DAY, HOUR, MINUTE and SECOND (excluding fractional seconds).
• Value range: Date value between '4714-11-24 BC' and '9999-12-31 AD' 
• Storage size: 8 bytes

For More Information

Refer to the followings.

FLOAT

Syntax

FLOAT[ ( precision ) ]

Syntax Rules and Parameters

Description

The floating point value with a binary precision is stored.
It has a binary precision value unlike NUMBER, NUMERIC types.

For More Information

Refer to the followings.

INTERVAL

Syntax

<interval_type> ::=
      INTERVAL YEAR [ ( leading_precision ) ] 
    | INTERVAL MONTH [ ( leading_precision ) ] 
    | INTERVAL DAY [ ( leading_precision ) ] 
    | INTERVAL HOUR [ ( leading_precision ) ] 
    | INTERVAL MINUTE [ ( leading_precision ) ]
    | INTERVAL SECOND [ ( leading_precision  [ , fractional_seconds_precision ] ) ]
    | INTERVAL YEAR [ ( leading_precision ) ] TO MONTH
    | INTERVAL DAY [ ( leading_precision ) ] TO HOUR
    | INTERVAL DAY [ ( leading_precision ) ] TO MINUTE
    | INTERVAL DAY [ ( leading_precision ) ] TO SECOND [ ( fractional_seconds_precision ) ]
    | INTERVAL HOUR [ ( leading_precision ) ] TO MINUTE
    | INTERVAL HOUR [ ( leading_precision ) ] TO SECOND [ ( fractional_seconds_precision ) ]
    | INTERVAL MINUTE [ ( leading_precision ) ] TO SECOND [ ( fractional_seconds_precision ) ]

Syntax Rules and Parameters

Description

INTERVAL types are classified into YEAR TO MONTH family type and DAY TO SECOND family type depending on the range of value representation as follows.
If the number which is bigger than number of the specified digits is in the field to which the leading_precision is specified, then an error is returned.
If the number which is bigger than number of the specified digits is in the field to which the fractional_seconds_precision is specified, it is rounded off.
Precisions and value range of the second or later field in INTERVAL * TO *

Field

Precision

Value range

MONTH

2

0 ~ 11

HOUR

2

0 ~ 23

MINUTE

2

0 ~ 59

SECOND (interger part)

2

0 ~ 59

For More Information

Refer to Interval Literals.

NATIVE_BIGINT

Syntax

NATIVE_BIGINT

Description

Signed 8-byte integer is stored.
It is as same as long long data type of C language (8 bytes integer).

NATIVE_DOUBLE

Syntax

NATIVE_DOUBLE

Description

Double precision floating-point number (8 bytes) is stored.
It is as same as double data type of C language.

NATIVE_INTEGER

Syntax

NATIVE_INTEGER

Description

Signed 4 byte integer is stored.
It is as same as integer data type of C language (4 bytes).

NATIVE_REAL

Syntax

NATIVE_REAL

Description

Single precision floating-point number (4 bytes) is stored.
It is as same as float data type of C language.

NATIVE_SMALLINT

Syntax

NATIVE_SMALLINT

Description

Signed 2 byte integer is stored.
It is as same as short data type of C language.

NUMBER

Syntax

NUMBER  [ ( precision [ , scale ] ) ]

Syntax Rules and Parameters

Description

NUMBER type is similar to NUMERIC type, but if both the precision and scale are omitted, NUMBER type stores the floating point number whose precision and scale are not specified.

For More Information

Refer to the followings.

NUMERIC

Syntax

NUMERIC  [ ( precision [ , scale ] ) ]

Syntax Rules and Parameters

Description

A fixed point number with precision and scale is stored.
If the precision and scale are omitted, it means as follows.
NUMBER type is similar to NUMERIC type, but if both the precision and scale are omitted, NUMBER type stores the floating-point number whose precision and scale is not specified.

For More Information

Refer to the followings.

ROWID

Syntax

ROWID

Description

A record identifier (ROWID) is stored.

A record identifier (ROWID) is the identification information of each record in database.

When querying the ROWID pseudo column, each record identifier (ROWID) is obtained. This ROWID pseudo column has the ROWID data type information.
ROWID type consists of the followings in a stand-alone system.
• OBJECT_ID 
• TABLESPACE_ID 
• PAGE_ID 
• OFFSET within PAGE
ROWID type consists of the followings in a cluster system.
• GRID_BLOCK_SEQUENCE
• GRID_BLOCK_ID
• MEMBER_ID
• SHARD_ID
ROWID is stored in the base 64 value, which can include A ~ Z, a ~ z, 0 ~ 9, +, /.
Each component information of ROWID is obtained using ROWID-related functions.
• Storage size: 16 bytes

For More Information

Refer to the followings.

TIME

Syntax

TIME [ ( fractional_seconds_precision ) ] [ WITH TIME ZONE | WITHOUT TIME ZONE ]

Syntax Rules and Parameters

Description

The time which includes HOUR, MINUTE and SECOND is stored.

For More Information

Refer to the followings.

TIMESTAMP

Syntax

TIMESTAMP [ ( fractional_seconds_precision ) ] [ WITH TIME ZONE | WITHOUT TIME ZONE ]

Syntax Rules and Parameters

Description

The time which includes YEAR, MONTH, DATE, HOUR, MINUTE and SECOND is stored.

For More Information

Refer to the followings.