|
Internet revolution has dramatically changed the way of
conducting global business. Enterprises nowadays are constantly transacting
business across boarders and time zones where each party involved has its own
notion of time. To help Oracle's customers conducting global E-Business,
Oracle9i provides extensive support of datetime datatypes that are compliant
with ANSI/OSI SQL99 standard.
Database Time Zone Parameter
There are two ways to create a database with a specific time
zone:
Session Time Zone Parameter
Similarly, the Time Zone parameter of a user session can also be
set to
Datetime Datatypes
To specify a time instance, you can use datetime datatypes such
as DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE and TIMESTAMP WITH LOCAL TIME ZONE.
Oracle supports the following timestamp datatypes:
- TIMESTAMP (fractional_seconds_ precision) Year,
month, and day values of date, as well as hour, minute, and second values of
time, where
fractional_seconds_precision optionally
specifies the number of digits in the fractional part of the SECOND
datetime field and can be a number in the range 0 to 9. The default is 6.
For example, you specify TIMESTAMP as a literal as follows:
TIMESTAMP'1997-01-31 09:26:50.124'
- TIMESTAMP (fractional_seconds_precision) WITH TIME ZONE
All values of TIMESTAMP as well as the time zone displacement value, where
fractional_seconds_precision
optionally specifies the number of digits in the fractional part of the SECOND
datetime field and can be a number in the range 0 to 9. The default is 6.
For example, you specify TIMESTAMP WITH TIME
ZONE as a literal as follows:
TIMESTAMP '1999-04-15 8:00:00 -8:00'
This can also be specified as
TIMESTAMP '1999-04-15 8:00:00 US/Pacific'
- TIMESTAMP (fractional_seconds_precision) WITH LOCAL TIME
ZONE All values of TIMESTAMP, with the following exceptions:
- Data is normalized to the database time zone when it is
stored in the database.
- When the data is retrieved, users see the data in the
session time zone.
Interval Datatypes
To specify a time duration, you can use the interval datatypes.
The interval datatypes are INTERVAL YEAR TO MONTH and INTERVAL DAY TO SECOND.
Values of interval datatypes are referred to as "intervals".
- INTERVAL YEAR (year_ precision) TO MONTH Stores a
period of time in years and months, where year_precision is the number of
digits in the YEAR datetime field. Accepted values are 0 to 9. The default
is 6.
- INTERVAL DAY (day_precision) TO SECOND (fractional_seconds_precision)
Stores a period of time in days, hours, minutes, and seconds, where
day_precision is the maximum number of digits in the DAY datetime field
(accepted values are 0 to 9; the default is 2), and
fractional_seconds_precision is the number of digits in the fractional part
of the SECOND field. Accepted values are 0 to 9. The default is 6.
More Info
Oracle9i
Database Daily Features
|
 |