Home » SQL & PL/SQL » SQL & PL/SQL » problem with to_number (oracle 10g)
problem with to_number [message #286705] Sun, 09 December 2007 23:22 Go to next message
raghunalumachu
Messages: 12
Registered: November 2007
Location: MUMBAI
Junior Member
hai,

I am using the below mentioned query

select to_number(substr(image_received_time,12,2)) from dailytrans;


to convert varchar to number here i had stored imagereceivedtime which is date(timestamp) in the format of varchar. So when i am
executing the query i am getting the result correctly but along with that and error message is being displayed as invalid number at to_number.

Thanks in Advance
Raghu

Re: problem with to_number [message #286707 is a reply to message #286705] Sun, 09 December 2007 23:26 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Because you have data that are not in the format you think it is expressed in your substr expression.

Regards
Michel
Thanks Michel [message #286711 is a reply to message #286707] Sun, 09 December 2007 23:41 Go to previous message
raghunalumachu
Messages: 12
Registered: November 2007
Location: MUMBAI
Junior Member
Yes there were some data which were not in the correct format .I was able to solve the issue by updating such records.Once again thanks for the solution.

Raghu
Previous Topic: Oracle 10g
Next Topic: Query for retrieving date records
Goto Forum:
  


Current Time: Fri Dec 09 09:57:21 CST 2016

Total time taken to generate the page: 0.05965 seconds