MS SQL Soundex function

MS SQL Soundex function

Post by Timmy Whel » Fri, 26 Apr 1996 04:00:00

Has anyone had any experiance of the built in SQL soundex function
returning incorrect values.  I have a situation where I have run the
function, creating a soundex value on a table with 1 million plus
rows.  The problem I have is that when run on columns with the same
value, it is returning differing results.




MS SQL Soundex function

Post by Richard Wil » Fri, 26 Apr 1996 04:00:00

No probs, try this in VB and see which one is correct.

Probaly no use at all.

Function soundex (ByVal c$) As String
' Converts the string C$ into a soundex value string
' Soundex consists of the first letter of the word followed by a number
' corresponding to the phonetic sound of the word.
'                  'abcdefghijklmnopqrstuvwxyz
Const Soundexstr = "01230100022455012623010202"
Dim o%, cnt%, a$, i%
Dim s As String * 1, os As String * 1

    If Trim(c$) = "" Then Soundex = "": Exit Function

    a$ = ""
    o% = 1
    cnt% = 1
        i% = Asc(Mid$(UCase(c$), cnt%, 1))
        If i% > 64 And i% < 91 Then
            If a$ = "" Then
                a$ = Chr(i%)
                os$ = ""
                s$ = Mid$(Soundexstr, i% - 64, 1)
                If s$ <> "0" And os$ <> s$ Then
                    o% = o% + 1
                    a$ = a$ + s$
                    os$ = s$
                End If
            End If
            o% = 5
        End If
        cnt% = cnt% + 1
    Loop While o% < 5 And cnt% <= Len(c$)

    Soundex = a$

End Function



1. pgsql/contrib/soundex (soundex.c

Author: tgl

Update of /home/projects/pgsql/cvsroot/pgsql/contrib/soundex

Modified Files:

-----------------------------  Log Message  -----------------------------

Revise handling of oldstyle/newstyle functions per recent discussions
in pghackers list.  Support for oldstyle internal functions is gone
(no longer needed, since conversion is complete) and pg_language entry
'internal' now implies newstyle call convention.  pg_language entry
'newC' is gone; both old and newstyle dynamically loaded C functions
are now called language 'C'.  A newstyle function must be identified
by an associated info routine.  See src/backend/utils/fmgr/README.

2. HELP: smart blob data gone

3. SOUNDEX - plans for SQL function?

4. Openxml

5. select soundex(string1), soundex(string2)

6. Anyone keeping a public SQL7 bug list?

7. pgsql/contrib/soundex (soundex.c)

8. FileMaker Pro vs MS SQL

9. SOUNDEX Function

10. Soundex and difference functions for UNICODE chars

11. soundex function

12. Soundex and difference functions for UNICODE chars

13. MS Access and user-defined functions in MS SQL