In my table i have PHONE NUMBER column.
the data of this is like 123-23-34567.
i want to retrive this phone number into 3 separate field of form module.
example : phno=123-23-34567 then
1st field 123
2nd field 23
3rd field 34567
Printable View
In my table i have PHONE NUMBER column.
the data of this is like 123-23-34567.
i want to retrive this phone number into 3 separate field of form module.
example : phno=123-23-34567 then
1st field 123
2nd field 23
3rd field 34567
Hi
You need to use instr and substr functions
select substr('123-23-3456',1,INSTR('123-23-3456','-',1,1)-1) from dual;
select substr('123-23-3456',INSTR('123-23-3456','-',1,1)+1,
INSTR('123-23-3456','-',-2,1)-INSTR('123-23-3456','-',1,1)-1)
from dual
and so on
regards
Hrishy
You could also use
select
substr(phno,1,3) first_field,
substr(phno,5,2) second_field,
substr(phno,7,5) third__field
from table_name