Subject Re: [IBO] SOUNDEX with IBOQuery
Author Helen Borrie (TeamIBO)
At 10:07 AM 18-06-02 -0400, you wrote:
>Can anyone tell me the syntax for using the SOUNDEX feature with the
>IBOQuery. I would like to incorporate it in a where statement.

It is set up in Column Attributes editor, similarly to the case-insensitive
searching except that, in the 'Soundex equivalent' field you enter the name
of the column containing the soundex "proxy" column, rather than an
uppercased proxy column, as you do in the 'Case-insensitive equivalent' field.

Of course, for Soundex to work, you have to have a populated, indexed
soundex column to begin with. Typically, this is populated by Before
Insert and Before Update triggers, using a soundex UDF that operates on the
new.column that you want to proxy-search by soundex. In the
OnSoundexParse handler of TIB_Connection, provide a parsing algorithm to
match the one being used on the server. (You could even make it fire an
IB_cursor to fetch the calculated code back to the app from the server -
select MySoundex(:searchstring) from rdb$database).

Then, in your select query, IBO will calculate (or fetch) the soundex code
for the search string and will search the soundex proxy column for matching
soundexes.

There's a soundex function in FreeUDFLib named f_GenerateSndxIndex and
there are others around; or you could write your own...do a Google search
for the UDFs and/or some algorithms. (In IB_Utils, there are two soundex
routines and a metaphone routine provided by Geoff)

regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com