Home » SQL & PL/SQL » SQL & PL/SQL » set values to timestamp .
set values to timestamp . [message #247401] Mon, 25 June 2007 15:00 Go to next message
yog_23
Messages: 79
Registered: March 2007
Member
How do I set a specific format to timestemp.

Can't figure out the format for the following value ?

The DATA values look like below.
01/01/3145 00:02:09.910
06/18/2007 16:25:56.441

DECLARE 
lSourceId TIMESTAMP(3); 
lDestId  TIMESTAMP(30);
BEGIN
lSourceId := TO_TIMESTAMP ('01/01/3145 00:02:09.910','MM/DD/YYYY HH23:MI:SSXFF');
END;


I am sure these values exist in database with these format but somthing is wrong in the format ?MM/DD/YYYY HH23:MI:SSXFF

Any help ?





Re: set values to timestamp . [message #247405 is a reply to message #247401] Mon, 25 June 2007 15:08 Go to previous messageGo to next message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
Isn't HH supposed to be 24 instead of 23?

Following code worked for me:

DECLARE 
lSourceId TIMESTAMP(3); 
BEGIN
   lSourceId := TO_TIMESTAMP ('01/01/3145 00:02:09.910','MM/DD/YYYY HH24:MI:SSXFF');
END;


Michael
Re: set values to timestamp . [message #247406 is a reply to message #247401] Mon, 25 June 2007 15:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Because HH23 does not exist. It is HH24.

Regards
Michel
Re: set values to timestamp . [message #247407 is a reply to message #247401] Mon, 25 June 2007 15:09 Go to previous messageGo to next message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
One obvious thing is it should be HH24 not HH23
Re: set values to timestamp . [message #247410 is a reply to message #247401] Mon, 25 June 2007 15:17 Go to previous messageGo to next message
yog_23
Messages: 79
Registered: March 2007
Member
sorry that was a typo.

It is 24... but it still doesn't work..its not finding the correct data when I use this format.
Re: set values to timestamp . [message #247411 is a reply to message #247401] Mon, 25 June 2007 15:18 Go to previous messageGo to next message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
Post the code
Re: set values to timestamp . [message #247602 is a reply to message #247401] Tue, 26 June 2007 08:31 Go to previous message
yog_23
Messages: 79
Registered: March 2007
Member
sorry about that..it works..was looking for a wrong value..thank you Smile
Previous Topic: Problem with join
Next Topic: String parsing
Goto Forum:
  


Current Time: Thu Dec 08 08:21:34 CST 2016

Total time taken to generate the page: 0.05827 seconds