insert into us3
(nr01, p01, p02, 
remfdate, remftime, remfuser, remdate, remtime, remuser)
SELECT peg_new_nr01('us3', 1) as nr01, 
       us3.p01 as p01, 
       '{pub_arr1[1]}' as p02, 
       
       curdate() as remfdate, 
       curtime() as remftime, 
       '{user_pswd}' as remfuser, 
       curdate() as remdate, 
       curtime() as remtime, 
       '{user_pswd}' as remuser
FROM us3
LEFT JOIN us3 as us3_1 ON us3_1.p01=us3.p01
                       && us3_1.p02='{pub_arr1[1]}'
WHERE us3_1.nr01 is null
GROUP BY us3.p01;
/*peg_end*/                       
       