Link to home
Start Free TrialLog in
Avatar of Sarma Vadlamani
Sarma Vadlamani

asked on

oracle query

hi,
can  you please advise how can i get the number part from the following string.

value

 #1(4):1589

i want to extract and check in where condition only the number that 1589 after :
thanks.
Avatar of johnsone
johnsone
Flag of United States of America image

Are you looking for everything after the colon?  That would be:

substr(your_column, instr(your_column, ':')+1)

Or, do you need to check that it is all numbers?
Avatar of Sean Stuber
Sean Stuber

is the colon variable?  that is, could it be some other delimiter?
if the number you want is always the end of the string then try this...

regexp_substr(your_string,'[0-9]+$')
Avatar of Sarma Vadlamani

ASKER

and regexp_substr(SQL_BIND,'[0-9]+$')=NVL(TO_NUMBER(:P_emp_no),emp.empno)
passing as parameter and trying where clause not returning any rows
but if i enter

regexp_substr(SQL_BIND,'[0-9]+$')='1001' then returning rows of empno 1001.
tried to convert to char but no use.
please advise.
ASKER CERTIFIED SOLUTION
Avatar of awking00
awking00
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial