Home » SQL & PL/SQL » SQL & PL/SQL » Extract Numeric Value (Oracle,9i,XP)
Extract Numeric Value [message #308599] Tue, 25 March 2008 00:52 Go to next message
gozuhair
Messages: 206
Registered: January 2008
Senior Member
Dear All


I have a created the following table.

create table cust_mst
(cust_cd varchar2(10),cust_nm varchar2(100),cust_add varchar2(100))

After this i have inserted the following values.

insert into cust_mst
(cust_cd,cust_nm,cust_add)
values
('001','Zuhair','710 Jauhar Belle View ,4613682')

insert into cust_mst
(cust_cd,cust_nm,cust_add)
values
('002','Ali','710 Jauhar Belle View ,03009213003')

insert into cust_mst
(cust_cd,cust_nm,cust_add)
values
('003','Abc','710 Jauhar Belle View ,768957')

I want the following output

4613682
03009213003
768957


please help.










Re: Extract Numeric Value [message #308602 is a reply to message #308599] Tue, 25 March 2008 00:54 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
What about this problem would classify it as 'Expert'?
Moved to newbies

[Updated on: Tue, 25 March 2008 00:55]

Report message to a moderator

Re: Extract Numeric Value [message #308611 is a reply to message #308599] Tue, 25 March 2008 01:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Always post your Oracle version (4 decimals).

Use SELECT, INSTR, SUBSTR.

Regards
Michel
Re: Extract Numeric Value [message #308619 is a reply to message #308611] Tue, 25 March 2008 01:20 Go to previous messageGo to next message
gozuhair
Messages: 206
Registered: January 2008
Senior Member
Thanks for the reply ,I will take care of formating next time but can you please tell me in details that how can i use instr funtion in this because i dont know the exact location of numeric value.

please make a query if it is possible


Thanks
Re: Extract Numeric Value [message #308626 is a reply to message #308619] Tue, 25 March 2008 01:48 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
find the position of the comma in your cust_add as all your numerice values comes after the comma.


regards,
Re: Extract Numeric Value [message #308627 is a reply to message #308619] Tue, 25 March 2008 01:51 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
INSTR

Regards
Michel
Previous Topic: Example for only clause?
Next Topic: Query for Retrieving first 2 records of an employee
Goto Forum:
  


Current Time: Sun Dec 11 00:23:51 CST 2016

Total time taken to generate the page: 0.11205 seconds