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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*LOADER and SYSDATE

Re: SQL*LOADER and SYSDATE

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Sun, 21 Mar 1999 14:45:33 +0100
Message-ID: <36f4f7ff$0$6783@newton>


jtkelly wrote

>TO_DATE(TO_CHAR(SYSDATE + 1, 'MM/DD/YYYY'), 'MM/DD/YYYY')
Apart from your problem, which has already been addressed, note that SYSDATE + 1 is really a date (not a number, nor a character string). So: no need to convert it to a character string first, and then back to a date.

In fact, be carefull using too much conversions. If you would have accidentially swap to_char and to_date in your line above, then you might get 0099 for the year... Try, and see what I mean:

or, if the example above gets you a conversion error,

    select to_char(to_date(sysdate + 1, 'dd-mon-yyyy'), 'dd-mon-yyyy')     from dual;

Depending on your system settings for NLS_DATE_FORMAT, the best that can happen is that you get a conversion error. The worst case would yield 0099 for the year...

If all you were trying to achieve is removing the timepart (effectively set it to 0:00:00 a.m.), then use trunc instead of two conversions:

    trunc(sysdate + 1)

or

    trunc(sysdate) + 1

Arjan. Received on Sun Mar 21 1999 - 07:45:33 CST

Original text of this message

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