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: Question concerning Oracle 8i and Format Mask command

Re: Question concerning Oracle 8i and Format Mask command

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 23 May 2002 06:48:11 +0200
Message-ID: <ueq4r47qm0kcc5@corp.supernews.com>

<jkutey_at_nospam.nycap.rr.com> wrote in message news:queoeukenvn61h822kt5a2aa6o3ni9vhmq_at_4ax.com...
> I have a question concerning Oracle 8i and Format Mask command.
>
> Here is the record in question:
>
> SELECT s_first, s_last
> FROM student
> WHERE s_class = 'FR'
> OR s_dob < TO_DATE('01-JAN-1981', 'DD-MM-YYYY');
>
> Why is it necessary for the 'DD-MM-YYYY' after the date? When I
> origionally inserted the values into the table, I already entered the
> date in the format '01-JAN-1981', 'DD-MM-YYYY. I tried writing the
> query without the DD-MM-YYYY, and it returned the same results.
>
> Thanks
> John

You implicitly used the default.
However, as the date is stored internally as a 7 byte column, not as a string, and the default format mask can be anything, and the default can be overridden, you should NEVER rely on the default. It may change. I once had a create table statement where in the default clause of a column, the developers where relying on the default date format. I had to export that table at the server, which didn't use that format. The table didn't create during import, all other tables were depended on that one table using foreign keys. You don't want know what happened. It was a disaster.

Regards

--
Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address
Received on Wed May 22 2002 - 23:48:11 CDT

Original text of this message

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