DECLARE
  l_hash dbms_obfuscation_toolkit.varchar2_checksum;
BEGIN
  FOR l_pwd IN (SELECT id
                      ,upper(username) || '/' || upper(username) AS str
                  FROM parties
                 WHERE username IS NOT NULL) LOOP
  
    l_hash := dbms_obfuscation_toolkit.md5(input_string => l_pwd.str);
  
    INSERT INTO passwords
      (prty_id
      ,password_hash
      ,created_on)
    VALUES
      (l_pwd.id
      ,l_hash
      ,SYSDATE);
  END LOOP;
END;
/
exit
