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 -> Insert date and time to a table

Insert date and time to a table

From: Y2K <y2000_at_pacbell.net>
Date: 15 Jun 1999 13:38:04 PDT
Message-ID: <3766BA5F.B8AE890E@pacbell.net>


I have a table (in Oracle 8.05) with a date column that stores date and time information. What's the best way to insert it so that when I do a select I'll have date (year, month, date) and time (hour, minute, second) and am/pm information? I've tried a couple of things with TO_DATE() function, but I was never able to get AM/PM information when I do a select. So I don't know if the info is lost or what. Here's one example of what I tried:

ALTER SESSION SET NLS_DATE_FORMAT = "MM/DD/YYYY HH:MI:SS AM"; update mytable set creationdate=TO_DATE('06/14/1999 08:44:39 PM','MM/DD/YYYY HH:MI:SS AM') where userid=0; select * from mytable;

Thanks for any pointers! Received on Tue Jun 15 1999 - 15:38:04 CDT

Original text of this message

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