Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Dates and Oracle

Re: Dates and Oracle

From: Mauro <sbffn_at_vgf.vg>
Date: Thu, 02 Jul 1998 11:56:44 GMT
Message-ID: <359b7531.17558918@news>


On Wed, 01 Jul 1998 14:48:19 +0200, Marcus Reichardt <mr_at_diamanda.hh.eunet.de> wrote:

>Linda Harte wrote:
>>
>> We have several client server applications connecting to
>> Oracle 7.3 and have just discovered some problems
>> with dates.
>>
>> One application inserts sysdate into a table
>> insert into table1 (the_date) values (sysdate)
>>

-snip-
>> It appears that SYSDATE inserts the current
>> time into the column as well and hence the
>> problem when trying to select data.

-snip-
>If you INSERT sysdate into a DATE collumn, you indeed insert the current
>db time as well. All you have to do is to truncate the time component:
>
>INSERT INTO table (the_date) values (to_date(to_char(sysdate,
>'dd-mm-yyyy'), 'dd-mm-yyyy')
>

Simpler:

        insert into table (the_date) values ( trunc(sysdate) ) ;

>Marcus Reichardt
>Consultant

--
Mauro.

(My return address is intentionally invalid; ROT13 is required. As someone already told this audience, my responses are not to be considered official technical support or advice.) Received on Thu Jul 02 1998 - 06:56:44 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US