insert into {p_mydt10tbl1}
(tbl, tbl_nr01, p00, p01, series, aa, issuedate, invtype, 
is_vat, is_name, is_address, is_city, is_zip, 
cp_vat, cp_name, cp_address, cp_city, cp_zip)

SELECT tbl as tbl, 
       tbl_nr01 as tbl_nr01, 
       p00 as p00, 
       p01 as p01, 
       series as series, 
       aa as aa, 
       issuedate as issuedate, 
       invtype as invtype, 
       if( mkfs in (2, 3), '{nt_p101[1]}', a_vat)     as is_vat, 
       if( mkfs in (2, 3), '{nt_p101[2]}', a_name)    as is_name, 
       if( mkfs in (2, 3), '{nt_p101[3]}', a_address) as is_address, 
       if( mkfs in (2, 3), '{nt_p101[4]}', a_city)    as is_city, 
       if( mkfs in (2, 3), '{nt_p101[5]}', a_zip)     as is_zip, 
       if( mkfs not in (2, 3), '{nt_p101[1]}', a_vat)     as cp_vat, 
       if( mkfs not in (2, 3), '{nt_p101[2]}', a_name)    as cp_name, 
       if( mkfs not in (2, 3), '{nt_p101[3]}', a_address) as cp_address, 
       if( mkfs not in (2, 3), '{nt_p101[4]}', a_city)    as cp_city, 
       if( mkfs not in (2, 3), '{nt_p101[5]}', a_zip)     as cp_zip
FROM ( {peg_str}
     ) as tbl01;