Home » SQL & PL/SQL » SQL & PL/SQL » how to convert varchar2 to number
how to convert varchar2 to number [message #574702] Tue, 15 January 2013 06:03 Go to next message
anniepeteroracle
Messages: 41
Registered: March 2012
Location: hyderabad
Member
How to convert varchar2 to number data?

Annie
Re: how to convert varchar2 to number [message #574703 is a reply to message #574702] Tue, 15 January 2013 06:07 Go to previous messageGo to next message
Michel Cadot
Messages: 57600
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use TO_NUMBER (with a format mask).

Maybe you should read the Database SQL Reference.

Regards
Michel

[Updated on: Tue, 15 January 2013 06:07]

Report message to a moderator

Re: how to convert varchar2 to number [message #574704 is a reply to message #574703] Tue, 15 January 2013 06:17 Go to previous messageGo to next message
anniepeteroracle
Messages: 41
Registered: March 2012
Location: hyderabad
Member
I have the data like x25628 and i need to change it with number,and again when i need the same data then i have to convert that number to get the same data like x25628---> certain number ----> x25628

Annie
Re: how to convert varchar2 to number [message #574707 is a reply to message #574704] Tue, 15 January 2013 06:29 Go to previous messageGo to next message
Michel Cadot
Messages: 57600
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Which number is x25628? For me it is a string not a number.
You have to better explain your requirements if you want some help.

Regards
Michel
Re: how to convert varchar2 to number [message #574709 is a reply to message #574704] Tue, 15 January 2013 06:30 Go to previous messageGo to next message
anniepeteroracle
Messages: 41
Registered: March 2012
Location: hyderabad
Member
the data is like
xa24534
32545x65f767

in this case this conversion will not going to work .so what is the solution for this type of data...

thanks for the above solution

Annie
Re: how to convert varchar2 to number [message #574711 is a reply to message #574709] Tue, 15 January 2013 06:33 Go to previous messageGo to next message
anniepeteroracle
Messages: 41
Registered: March 2012
Location: hyderabad
Member
the data is in varcha2('xa24534','x25628','32545x65f767')

Annie
Re: how to convert varchar2 to number [message #574713 is a reply to message #574709] Tue, 15 January 2013 06:37 Go to previous message
Solomon Yakobson
Messages: 1788
Registered: January 2010
Senior Member
anniepeteroracle wrote on Tue, 15 January 2013 07:30
so what is the solution for this type of data...


What type of data? What does X represent in your string? What result are you expecting from xa24534 and from
32545x65f767? And what is the logic to get such results? Learn how to ask a question. Put yourself into answerer's shoes and think did I provide all that's needed to provide solution.

SY.
Previous Topic: update statement help
Next Topic: dates question
Goto Forum:
  


Current Time: Wed Apr 16 08:24:31 CDT 2014

Total time taken to generate the page: 0.05942 seconds