select * 
from rpt.f12z_2019_pg( 
'frm12_15' ::varchar, 
2 ::int4, 
18 ::int8, 
120 ::int8, 
cast($1 as bigint), 
$2 ::varchar, 
cast($3 as bigint),  
cast($4 as bigint),  
to_timestamp($5, 'DD.MM.YYYY') ::timestamp, 
to_timestamp($6, 'DD.MM.YYYY') ::timestamp, 
cast($7 as bigint), 
cast($8 as bigint)) 
order by "RepDiag_Row"
