Both datetimes and intervals are made up of fields. The values of these fields determine the value of the data type.
The datetime data types are:
DATE
TIME
TIME WITH TIME ZONE
TIMESTAMP
TIMESTAMP WITH TIME ZONE
TIMESTAMP WITH LOCAL TIME ZONE
Values of datetime data types are sometimes called datetimes. In the following descriptions of the datetime data types you will see that, except for DATE
, you are allowed to optionally specify a value for fractional_second_precision
. The fractional_second_precision
specifies the number of digits stored in the fractional part of the SECOND
datetime field. When you create a column of this data type, the value can be a number in the range 0 to 9. The default is 6.
The interval data types are:
INTERVAL YEAR TO MONTH
INTERVAL DAY TO SECOND
Values of interval data types are sometimes called intervals. The INTERVAL YEAR TO MONTH
data type lets you optionally specify a value for year_precision
. The year_precision
value is the number of digits in the YEAR
datetime field. The default value is 2.
The INTERVAL DAY TO SECOND
data type lets you optionally specify values for day_precision
and fractional_second_precision
. The day_precision
is the number of digits in the DAY
datetime field. Accepted values are 0 to 9. The default is 2. The fractional_second_precision
specifies the number of digits stored in the fractional part of the SECOND
datetime field. When you create a column of this data type, the value can be a number in the range 0 to 9. The default is 6.
"Specifying Datetime Formats At the Table Level" for information about specifying datetime data types at the table level in a SQL*Loader control file
Oracle Database SQL Language Reference for more detailed information about specifying datetime and interval data types, including the use of fractional_second_precision
, year_precision
, and day_precision