insert into q31
(nr01, p01, p03, p05, 
remfdate, remftime, remfuser, remdate, remtime, remuser)
SELECT peg_new_nr01('q31', 1) as nr01, 
       q31.p01 as p01, 
       '{peg_str2}' as p03, 
       q31.p05 as p05, 
       
       curdate() as remfdate, 
       curtime() as remftime, 
       '{user_pswd}' as remfuser, 
       curdate() as remdate, 
       curtime() as remtime, 
       '{user_pswd}' as remuser
FROM q31
WHERE q31.p01={tmp1->nr01}
   && q31.p03='{peg_str1}';