The social network for Oracle people
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.
Some examples:
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:
1. http://docs.oracle.com/cd/E14072_01/appdev.112/e10577/u_match.htm
2. http://psoug.org/reference/utl_match.html
Hope you find this informative and useful.
© 2013 Created by Eddie Awad.