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: How do I insert date/time into a ORACLE date field?????? - new to ORACLE

Re: How do I insert date/time into a ORACLE date field?????? - new to ORACLE

From: Paul Austin <pda1_at_ukc.ac.uk>
Date: 1997/01/21
Message-ID: <32E51FE4.3F58@ukc.ac.uk>#1/1

Glynn Smith wrote:
> insert into fi_test(create_date) values ( x );
>

On most ORACLE severs the default date format is DD-MON-YY with no time information. What you need to do is use the TO_DATE(x, fmt) function when setting the date and TO_CHAR(create_Date, fmt) when retreiving the date if you want to use another format. Below I have shown some example formats for the dates specified

TO_DATE('1/20/1997 12:34:23', 'MM/DD/YYYY HH:MI:SS)
TO_DATE('12-23-1996 14:35:34', 'MM-DD-YYY HH24:MI:SS)
TO_DATE('1-JAN-97 12:45:43', 'DD-MON-YY HH:MI:SS)

Hope this helps
paul



Paul Austin, Analyst, WPPS Supplier Data. Ford Motor Company 40/432, Trafford House, 8 Station Way, Basildon, Essex SS16 5XX PROFS: PAUSTIN, INTERNET: paustin_at_gw.ford.com, UNI: pda1_at_ukc.ac.uk Tel.44-1268-703016/718-3016 Fax.44-1268-703673/718-3673 Received on Tue Jan 21 1997 - 00:00:00 CST

Original text of this message

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