Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

EDIT_DISTANCE_SIMILARITY

BilalKhanMay 19 2010 — edited May 21 2010
Consider that we have a table containing 1000 row and 5 column.
we want to apply th e UTL_MATCH.EDIT_DISTANCE_SIMILARITY function to all of the table to
find the match in following manners.

1) Take the value of first row of first column and compare it with the value of 2nd row 1st column
by using EDIT_DISTANCE_SIMILARITY function (if match is greater then 80%),
similarly take the value of first row of 2nd column and compare it with the value of 2nd row 2nd column
(where calculate the match, if it is greater then 80%)
similarly take the value of first row of 3rd column and compare it with the value of 2nd row 3rd column
and so on, and apply UTL_MATCH.EDIT_DISTANCE_SIMILARITY function.
if found match in 4 the column value out of 5 is greater then 80 then delete the 2nd row and commit the changes.

follow the above procedure and compare the 1st row with all the rows of table, then take the 2nd row and compare it with 3rd,
4th, 5th, ..... the rows.
then take the 3rd row and compare it with the 4th, 5th, ........ row. and so on.
SQL> ed
Wrote file afiedt.buf

  1  create table xyz
  2  (name varchar2(20),
  3  fname varchar2(20),
  4  address varchar2(30),
  5  job varchar2(15)
  6* )
SQL> /

Table created.
SQL> insert into xyz values('&name', '&FatherName', '&address', '&job');
Enter value for name: Bilal Khan
Enter value for fathername: Wali ur Rehman
Enter value for address: district abbottababad, nwfp.
Enter value for job: Only student
old   1: insert into xyz values('&name', '&FatherName', '&address', '&job')
new   1: insert into xyz values('Bilal Khan', 'Wali ur Rehman', 'district abbottababad, nwfp.', 'Only student')

1 row created.

SQL> set verify off
SQL> /
Enter value for name: Khan Bilal 
Enter value for fathername: Wali ur rehman
Enter value for address: dist abbottabd
Enter value for job: student

1 row created.
 




SQL> /
Enter value for name: Khan
Enter value for fathername: Wali-ur-Rahman
Enter value for address: abbottabad
Enter value for job: student

1 row created.

SQL> /
Enter value for name: Bilal Khan
Enter value for fathername: wali
Enter value for address: nwfp abbottabad
Enter value for job: student

1 row created.
THANKS AND

Regards.
This post has been answered by BluShadow on May 19 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2010
Added on May 19 2010
33 comments
3,823 views