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: The number of bytes corresponding to the length value

For More Information

Refer to the following.

BINARY VARYING

Syntax

BINARY VARYING (length)

Syntax Rules and Parameters

Description

A variable-length binary string is stored.

• Storage size: The number of bytes of the binary string to be stored
• Alias names: VARBINARY

For More Information

Refer to the following.

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: The number of bytes of the binary string to be stored
• Alias names: LONG BINARY VARYING, LONG VARBINARY
It cannot be used as a column of the key, so there are the following limitations:

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

For More Information

Refer to the following.

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, whitespace characters are stored in the remaining space.

For More Information

Refer to the following.

CHARACTER VARYING

Syntax

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

Syntax Rules and Parameters

Description

The variable-length string is stored.

• Storage size: The number of bytes of the string to be stored
• Alias names: VARCHAR, VARCHAR2

For More Information

Refer to the following.

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: The number of 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 the following limitations:

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

For More Information

Refer to the following.

DATE

Syntax

DATE

Description

It is a date type that includes YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND (excluding fractional seconds).

• Value range: Date values between '4714-11-24 BC' and '9999-12-31 AD' 
• Storage size: 8 bytes

For More Information

Refer to the following.

FLOAT

Syntax

FLOAT[ ( precision ) ]

Syntax Rules and Parameters

Description

A floating-point value with binary precision is stored.
It has a binary precision value, unlike the NUMBER and  NUMERIC types.

For More Information

Refer to the following.

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 can be classified into two families—YEAR TO MONTH and DAY TO SECOND—based on the range of value representation, as follows.
If a number larger than the specified number of digits is entered in a field where leading_precision is specified, an error is returned.
If a number larger than the specified number of digits is entered in a field where fractional_seconds_precision is specified, it is rounded off.
In the **INTERVAL * TO *** type, the precision and value range of the fields after the second field.

Field

Precision

Value range

MONTH

2

0 ~ 11

HOUR

2

0 ~ 23

MINUTE

2

0 ~ 59

SECOND (integer part)

2

0 ~ 59

For More Information

Refer to Interval Literals.

NATIVE_BIGINT

Syntax

NATIVE_BIGINT

Description

A signed 8-byte integer is stored.
It is the same as the long long data type in C language (8 byte integer).

NATIVE_DOUBLE

Syntax

NATIVE_DOUBLE

Description

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

NATIVE_INTEGER

Syntax

NATIVE_INTEGER

Description

A signed 4-byte integer is stored.
It is the same as the integer data type in C language (4 bytes).

NATIVE_REAL

Syntax

NATIVE_REAL

Description

A single-precision floating-point number (4 bytes) is stored.
It is the same as the float data type in C language.

NATIVE_SMALLINT

Syntax

NATIVE_SMALLINT

Description

A signed 2-byte integer is stored.
It is the same as the short data type in C language.

NUMBER

Syntax

NUMBER  [ ( precision [ , scale ] ) ]

Syntax Rules and Parameters

Description

The NUMBER type is similar to the NUMERIC type, but if both precision and scale are omitted, the NUMBER type stores a floating-point number without specified precision and scale.

For More Information

Refer to the following.

NUMERIC

Syntax

NUMERIC  [ ( precision [ , scale ] ) ]

Syntax Rules and Parameters

Description

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

For More Information

Refer to the following.

ROWID

Syntax

ROWID

Description

The ROWID type stores the record identifier (ROWID).

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

When querying the ROWID pseudo column, the corresponding record identifier (ROWID) value for each record can be obtained. This ROWID pseudo column has the ROWID data type.
The components of the ROWID type in a standalone system are as follows:
• OBJECT_ID 
• TABLESPACE_ID 
• PAGE_ID 
• OFFSET within PAGE
The components of the ROWID type in a cluster system are as follows:
• GRID_BLOCK_SEQUENCE
• GRID_BLOCK_ID
• MEMBER_ID
• SHARD_ID
ROWID is stored in a base-64 value, which can include A ~ Z, a ~ z, 0 ~ 9, +, and /.
The components of the ROWID can be obtained using ROWID-related functions.
• Storage size: 16 bytes

For More Information

Refer to the following.

TIME

Syntax

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

Syntax Rules and Parameters

Description

The time, including HOUR, MINUTE, and SECOND, is stored.

For More Information

Refer to the following.

TIMESTAMP

Syntax

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

Syntax Rules and Parameters

Description

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

For More Information

Refer to the following.