Home » SQL & PL/SQL » SQL & PL/SQL » new data type of oracle 9i
new data type of oracle 9i [message #21167] Tue, 16 July 2002 21:38 Go to next message
Ahmed
Messages: 36
Registered: November 2000
Member
Somebody help me to understand the new data types of oracle 9i

INTERVAL YEAR TO MONTH
&
INTERVAL DAY TO SECONDS

Please give me the idea to use this

if possible give me the example of

Table creation using this data type
& insertion & selection of this data type

I will be thankfull to you.

Ahmed Ali
Re: new data type of oracle 9i [message #21173 is a reply to message #21167] Wed, 17 July 2002 02:23 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
from the docs
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 2.

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.
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. 
 
CREATE TABLE test
          ( d_ymint                INTERVAL YEAR(2) TO MONTH,
            d_dsint                INTERVAL DAY(2) TO SECOND(6));
SQL> INSERT INTO dt VALUES 
          ( INTERVAL'12-01' YEAR TO MONTH,
            INTERVAL '50 10:20:20.123' DAY(2) TO SECOND(3));

Previous Topic: Default values of a column
Next Topic: NLS-Char Set Problem.
Goto Forum:
  


Current Time: Fri Apr 26 22:50:47 CDT 2024