Assuming that I have only one table : members_tbl which columns are : SN, FN, DB, IDDBL,FLAG, DBLCRIT
I need to update the table if some conditions are OK with this algorithm :
id_dup := 1;
FOR (i in 1 to Nrow(members_tbl)) THEN
{
FOR (j in (i+1) to Nrow(members_tbl)) THEN
{
IF(members_tbl(i).iddbl IS NULL) THEN
members_tbl(i).iddbl := id_dup
IF (((members_tbl(i).DB ==members_tbl(j).DB)
AND (UTL_MATCH.jaro_winkler_similarity(members_tbl(i).SN,members_tbl(j).SN) > 80)
AND (UTL_MATCH.jaro_winkler_similarity(members_tbl(i).FN,members_tbl(j).FN) > 80))
AND (members_tbl(j).iddbl IS NULL)) THEN
{
members_tbl(j).iddbl := id_dup;
members_tbl(i).flag := 1;
members_tbl(j).flag := 1;
members_tbl(i).dblcrit:= 1;
members_tbl(j).dblcrit:= 1;
}
}
id_dup := id_dup + 1;
}
Is there a way to write this algorithm in a pl/sql procedure ? I'm relatively new to PL/SQL and i've never written a stored procedure.