String Compare in PL/SQL

String Compare in PL/SQL

Post by David Schweisgu » Thu, 08 Oct 1998 04:00:00

: My best guess is that Oracle translates an empty string to a NULL, which is
: not the same thing.

You are correct. No, it's not the same thing. Yes, it's obnoxious. You just
have to write your code to special-case nulls.



1. Comparing two sql strings


I have two varchar strings I want to compare and then generate a probablity
statistic that they are the same.  The columns contain names of companies
and I am cleaning up a very messy table

I may have

for instance suppose the two strings are:

string 1:
First National Bank of Boston

string 2
1st  Bank of Boston

Assume these two entities are actually the same and the difference is due to
input error. I would want a high score for these two strings.

I wrote a t-sql function that parses out one string 1 and then performs a
CHARINDEX function on string_1 and string_2 in a loop. Each time a word is
matched I derive a score, I even score words a little differently; "and',
"the", "of" etc. receive a small score where other words recieve larger
scores. This works, but it TAKES FOREVER.

I have tried soundex and difference, but I don't like this approach too
much - the scores aren't to reliable.

Any suggestions/


2. Best design

3. SP performing poorly compared to execute sql-string

4. No data after OLAP Service Pack 1 Installation

5. Comparing Null values in PL/SQL with varchar2

6. Run-time error 3136

7. SQL-92, Migrate PL/SQL at ORACLE into PL/SQL at SQL Server 7.0

8. Notification Services samples

9. String comparison in PL/SQL

10. ? PL/SQL: numeric or value error: character string buffer too small

11. Can Pl/SQL execute a string?

12. PL/SQL and 32K+ String Vars...