Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Insert date and time to a table
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