Re: CDBI and Oracle dates

[prev] [thread] [next] [Date index for 2004/11/24]

From: Jay Strauss
Subject: Re: CDBI and Oracle dates
Date: 19:45 on 24 Nov 2004
Josh Peterson wrote:
> Does anyone know how I can insert date _and_ time information into an
> Oracle DATE field?
> 
> I'm working with an Oracle 9.2.0.4.0 database table's DATE field using
> CDBI.  Since Oracle expects a specific date format, DD-MMM-YY, I can
> convert a date to that string format, and save it, but I then lose the
> time information.  
> 
> Any thoughts on a workaround?
> 
> -Josh

Yes, an Oracle date field stores time, down to the second.  If you need 
more granularity, there is a new datatype called timestamp

You use the to_char, to_date functions in Oracle to get at the desired 
portions of a date field.

for example:

select to_char(sysdate, 'MM/DD/YYYY HH24,MI,SS') from dual;

CDBI and Oracle dates
Josh Peterson 18:18 on 24 Nov 2004

Re: CDBI and Oracle dates
Jay Strauss 19:45 on 24 Nov 2004

Re: CDBI and Oracle dates
Jay Strauss 19:56 on 24 Nov 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52