select * 
from rpt.f12a_2019_pg( 
'frm12_2019' ::varchar, 
1000 ::integer, 
0 ::int8, 
14 ::int8, 
cast($1 as int8), 
$2 ::varchar, 
cast($3 as int8), 
cast($4 as int8), 
to_timestamp($5, 'DD.MM.YYYY') ::timestamp, 
to_timestamp($6, 'DD.MM.YYYY') ::timestamp, 
cast($7 as int8), 
cast($8 as int8)) 
order by "RepDiag_Row" 
