Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: String Comparisons in Oracle 9i

Re: String Comparisons in Oracle 9i

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Mon, 22 Oct 2007 13:54:17 -0500
Message-ID: <471ce5fc$0$24277$88260bb3@free.teranews.com>


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.com
Received on Mon Oct 22 2007 - 13:54:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US