Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: String Comparisons in Oracle 9i
Fester Bestertester wrote:
> Greetings,
>
> We are using Oracle 9i. Are regexp functions available in Oracle 9i, or
> was that introduced with 10?
>
> Given the following two strings:
> str_a='5838 MISSION CENTER RD #C'
> str_b='5838 MISSION CENTER RD C'
>
> or
> str_a='7576 PARKWAY DR APT #2A'
> str_b='7576 PARKWAY DR APT 2A'
>
> is it possible to write an expression in Oracle 9i that will return true
> if the only difference between the two strings is the presence of the
> '#' symbol?
Regular expressions were introduced in 10g.
In your example, you can use the TRANSLATE function to remove the '#' sign and see if the two strings are equivalent:
IF TRANSLATE(str_a,'#','') = TRANSLATE(str_b,'#','') THEN ....
HTH,
Brian
-- =================================================================== Brian Peasland dba_at_nospam.peasland.net http://www.peasland.net Remove the "nospam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three" - Unknown -- Posted via a free Usenet account from http://www.teranews.comReceived on Mon Oct 22 2007 - 13:54:17 CDT