select * from rpt1.ksg_htm_pg(
cast($1 as bigint),
cast($2 as bigint),
cast($3 as bigint),
cast($4 as bigint),
cast($5 as bigint),
cast($6 as bigint),
cast($7 as bigint),
cast(to_timestamp($8, 'DD.MM.YYYY') as timestamp),
cast(to_timestamp($9, 'DD.MM.YYYY') as timestamp),
cast($10 as integer),
cast($11 as integer),
cast($12 as integer),
cast($13 as integer)) 
