Today I came across an oracle utility package to compare strings viz. UTL_MATCH. UTL_MATCH comes with Oracle version 11g release 1.
The four functions in this package are:
All the four functions take two string argument as inputs.
select UTL_MATCH.EDIT_DISTANCE(‘PLSQL’,'SQL’) from dual; — This returns 2. Indicating that changing two characters in first string should get second string
select UTL_MATCH.EDIT_DISTANCE(‘HANG SENG’,'NASDAQ’) from dual; This returns 7. Indicating that changing 7 characters in first string should get second string
select UTL_MATCH.edit_distance_similarity(‘PLSQL’,'SQL’) from dual; — This Returns 60.
select UTL_MATCH.edit_distance_similarity(‘HANG SENG’,'NASDAQ’) from dual; — Returns 23.
For more info you can checkout following reference links:
Hope you find this informative and useful.
Comments are closed for this blog post