Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
The Oracle interval data type (Read 2082 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
The Oracle interval data type
19.01.09 at 13:52:38
 
The Oracle interval data type
 
Interval datatypes store time durations. They are used primarily with analytic functions.
 
INTERVAL YEAR [(year_precision)] TO MONTH
INTERVAL DAY [(day_precision)] TO SECOND [(fractional_seconds_precision)]
 
The default precisions are:
Two decimal positions for a year
Two decimal positions for a day
Six decimal positions for a second
 
Example:
create table my_intervals
( i interval year to month
, i2 interval day to second);

 
Further reading:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28298/ch4datetime.htm#i 1006226
Back to top
 
« Last Edit: 19.01.09 at 14:00:08 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Insert values into Oracle interval columns
Reply #1 - 19.01.09 at 14:03:12
 
Insert values into Oracle interval columns
 
To insert values into Oracle interval columns you can use the following syntax.
 
Insert an interval of 13 years and 2 months:
insert into myinterval (i) values (interval '13-2' year to month);
 
Insert an interval of 2 days, 15 hours, 23 minutes, 3 seconds and 128 thousandthsof a second.:
insert into myinterval (i2) values (interval '2 15:23:03.128' day to second);
Back to top
 
« Last Edit: 19.01.09 at 14:08:38 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1