select * 
from "rpt"."han_ls_leavetype_pg"(
cast($1 as int8),
cast($2 as varchar),
cast($3 as int8), 
cast($4 as int8), 
cast($5 as int8), 
cast($6 as int8), 
cast($7 as int8),
cast(TO_TIMESTAMP($8,'DD.MM.YYYY') as timestamp), 
cast(TO_TIMESTAMP($9,'DD.MM.YYYY') as timestamp),
cast($10 as int8)
) order by lpusection_name1,lev desc 
