update i70, z_i70_std as imp01
set i70.p01=imp01.p01, 
    i70.p02=imp01.p02, 
    i70.p03=imp01.p03, 
    i70.p04=imp01.p04, 
    i70.p05=imp01.p05, 
    i70.p06=imp01.p06, 
    i70.p06_1=imp01.p06_1, 
    i70.p07=imp01.p07, 
    i70.p106=imp01.p106, 

    i70.is_std=imp01.is_std, 
    
    i70.remdate=curdate(), 
    i70.remtime=curtime(), 
    i70.remuser='{user_pswd}@std_tables'
     
where i70.nr01=imp01.nr01
   && (    i70.p01<>imp01.p01 
        || i70.p02<>imp01.p02 
        || i70.p03<>imp01.p03 
        || i70.p04<>imp01.p04 
        || i70.p05<>imp01.p05 
        || i70.p06<>imp01.p06 
        || i70.p06_1<>imp01.p06_1 
        || i70.p07<>imp01.p07 
        || i70.p106<>imp01.p106 
        || i70.is_std<>imp01.is_std 
      );
/*peg_end*/

insert into i70
(nr01, p01, p02, p03, p04, p05, p06, p06_1, p07, p106, is_std, p300,
remfdate, remftime, remfuser, remdate, remtime, remuser)
select imp01.nr01, 
       imp01.p01, 
       imp01.p02, 
       imp01.p03, 
       imp01.p04, 
       imp01.p05, 
       imp01.p06, 
       imp01.p06_1, 
       imp01.p07, 
       imp01.p106, 
       imp01.is_std, 
       imp01.p300, 
       
       curdate() as remfdate, 
       curtime() as remftime, 
       '{user_pswd}@std_tables' as remfuser, 
       curdate() as remdate, 
       curtime() as remtime, 
       '{user_pswd}@std_tables' as remuser 
from z_i70_std as imp01
left join i70 on i70.nr01=imp01.nr01
where i70.nr01 is null;
/*peg_end*/