/****************
    i32
*****************/    
INSERT INTO i32
(nr01, p00, p01, p02, p010, 
remdate, remtime, remuser, remfdate, remftime, remfuser)
SELECT peg_new_nr01('i32', 1)  as nr01, 
       p00 as p00, 
       p01 as p01,
       p02 as p02, 
       p010 as p010, 

       curdate() as remdate, 
       curtime() as remtime, 
       '{user_pswd}' as remuser, 
       curdate() as remfdate, 
       curtime() as remftime, 
       '{user_pswd}' as remfuser
FROM {p_i07tbl2}
WHERE i07p06<>0;
/*peg_end*/

update {p_i07tbl2} set i07p06=i07p06+1 where i07p06<0;
/*peg_end*/

update {p_i07tbl2} set i07p06=i07p06-1 where i07p06>0;
/*peg_end*/

delete from {p_i07tbl2} where i07p06=0;
/*peg_end*/
