Hi,
A number of database versions back I developed a function to check one string against another string, moving through the string X characters, at a time and looking for a match in the other string (the characters are in the other string in the same order, with nothing between).
i.e.
String 1 'ABCDE' - the string to compare
String 2 'ABDEF' - the string to compare to
The number of characters to compare 2
So first two characters of string 1 - 'AB' - does it match to string 2 - yes - so 1 match
So move along one, and try again, next two characters of string1 - 'BC' - does it match to string 2 - no, so no match
So move along one, and try again, next two characters of string1 - 'CD' - does it match to string 2 - no, so no match
So move along one, and try again, next two characters of string1 - 'DE' - does it match to string 2 - yes, so +1 match
So out of 4 potential matches we have 2 hits, so using 2 character match this is a 50% score
In my original scenario, string 1, string 2 and the number of characters were all IN parameters, the function returning a number 0 to 100.
My question is, for purposes of speed I need to achieve similar match functionality on a massive data set and do not want to do this by a function, is there anyway using regex or similar existing database functions to achieve the same functionality??
My DB is 12c