Home » SQL & PL/SQL » SQL & PL/SQL » timestamp (oracle 10g)
timestamp [message #351584] Wed, 01 October 2008 11:38 Go to next message
jmkumar08
Messages: 3
Registered: October 2008
Junior Member
Hi,

I am getting date from one view (ex:10-jan-2008) no time stamp..
But i WOULD LIKE TO STORE THAT VALUE WITH TIME STAMP (EX: 10-JAN-2008 12:23:23AM) INTO ANOTHER ANOTHER TABLE ..PLS HELP ME OUT THX
Re: timestamp [message #351587 is a reply to message #351584] Wed, 01 October 2008 11:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
DATE contains timestamp.

Post a test case: create table and insert statements along with the result you want with these data.

Regards
Michel
Re: timestamp [message #351593 is a reply to message #351584] Wed, 01 October 2008 12:01 Go to previous messageGo to next message
jmkumar08
Messages: 3
Registered: October 2008
Junior Member
I am getting 10-jan-2008 format only ....It's not loading into table....
Re: timestamp [message #351603 is a reply to message #351593] Wed, 01 October 2008 12:34 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This discussion promises to last forever, unless you suddenly decide to provide useful information.
Re: timestamp [message #351605 is a reply to message #351593] Wed, 01 October 2008 12:37 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I am getting 10-jan-2008 format only

Because you just didn't read SQL Reference and TO_CHAR function.

Regards
Michel
Re: timestamp [message #351609 is a reply to message #351584] Wed, 01 October 2008 12:58 Go to previous messageGo to next message
jmkumar08
Messages: 3
Registered: October 2008
Junior Member
Michel,

Here is the query :
(MK_TEST HAS ONLY ONE COLUMN WITH DATE TYPE)
(TEMP_TABLE HAS BEGIN_DATE WITH DATE TYPE)
insert into mk_test select to_char(BEGIN_DATE,'dd-mon-yyyy hh:mm:ssam') from TEMP_TABLE...

I WAS TRYING IN THIS WAY ALSO

insert into mk_test select TO_dATE(to_char(BEGIN_DATE,'dd-mon-yyyy hh:mm:ssam'),'DD-MON-YYYY HH:MM:SSAM') from TEMP_TABLE...



Re: timestamp [message #351610 is a reply to message #351609] Wed, 01 October 2008 13:02 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As already stated, DATE datatype column contains both date AND time. So, there's no need to do that mumbo-jumbo, but simply
INSERT INTO second_table (date_column)
SELECT date_column FROM first_table

Knowing HOW TO DISPLAY date and time is another question; do you know how to do that? What is the result of
SELECT sysdate FROM dual
executed at your SQL*Plus prompt?
Re: timestamp [message #351612 is a reply to message #351609] Wed, 01 October 2008 13:05 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Michel Cadot wrote on Wed, 01 October 2008 18:45
DATE contains timestamp.

Post a test case: create table and insert statements along with the result you want with these data.

Regards
Michel


Previous Topic: UPDATE QUERY
Next Topic: Ceating a series of records with a pattern
Goto Forum:
  


Current Time: Sat Dec 03 06:06:43 CST 2016

Total time taken to generate the page: 0.09484 seconds