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).DBIRTH ==members_tbl(j).DBIRTH) AND
    (UTL_MATCH.jaro_winkler_similarity(members_tbl(i).SNAME,members_tbl(j).SNAME) > 80) AND
  (UTL_MATCH.jaro_winkler_similarity(members_tbl(i).FNAME,members_tbl(j).FNAME) > 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;
}

```

Here is a test case :

```
CREATE TABLE MEMBERS_TBL
  (
    IDM     NUMBER(9) NOT NULL ,
    SNAME   VARCHAR2(20) ,
    FNAME   VARCHAR2(20) ,
    DBIRTH  VARCHAR2(15) ,
    IDDBL   NUMBER(10) ,
    FLAG    SMALLINT ,
    DBLCRIT SMALLINT
  );
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (125,'BOLOREY','JEANNE','11/05/1955',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (126,'BOLLOREY','JEANNE','11/05/1955',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (153,'BALORE','GIANNE','11/05/1955',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (223,'ABOLLOREYY','JEANNE','11/05/1955',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (225,'FIABLE','MARINE','25/04/1963',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (228,'FAIBLE','MARYANE','25/04/1963',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (230,'FAIBLE','MARINE','25/04/1963',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (235,'LIPARK','JACQLINE','20/12/1939',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (236,'ILIPARC','JACQUELYNE','20/12/1939',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (237,'LIPARC','JACQUELHINE','20/12/1939',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (240,'RINTET','MALIKA','07/08/1954',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (241,'GRISION','RAUGER','26/10/1931',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (242,'GRISION','ROGER','26/10/1931',NULL,NULL,NULL);
Insert into members_tbl (IDM,SNAME,FNAME,DBIRTH,IDDBL,FLAG,DBLCRIT) values (245,'GRESION','RAUJER','26/10/1931',NULL,NULL,NULL);

```

to be more comprensive, i do change columns SN in SNAME, FN in FNAME and DB in DBIRTH

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.