Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle string issue
Thanks for that Chris. I was not aware that I could use that function.
However I did not elaborate on the problem I had. I want to see if
there is a sequence of 10 or more consecutive digits in a string. I
could use the translate function and check for the length, but I guess
that would create quite a bit of overhead.
Nilay
chris.hulan_at_gmail.com wrote:
> nilaybhagat_at_gmail.com wrote:
> > Im using Oracle 9.2 and I am having trouble extracting digits from a
> > string. I tried using LIKE %[0-9]% but this version does not support
> > that. I also cannot use regular expressions for that same reason. Is
> > there an easier way to identify digits or do I have to create a
> > function to do that.
> >
> > Thanks!
>
> The translate function might help:
>
>
> SELECT TRANSLATE (upper('This 1 string 2 contains 3 digits 4!')
> ,'1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ !'
> ,'1234567890'
> )
> FROM DUAL;
>
> Note I had include a ' ' (space) and a '!' to have those removed,
> similarly you'll need to add any special characters to have them
> removed.
>
> HTH
> Chris
Received on Mon Oct 16 2006 - 13:36:47 CDT