DROP FUNCTION IF EXISTS dbo.fn_GetChulpanReestrItemCount;
CREATE FUNCTION dbo.fn_GetChulpanReestrItemCount(ReestrID UUID)
	RETURNS Integer AS
 $$
 Begin
	return 
	(
		select count(*)
		from akuz.T_CHULPAN_REESTR_ITEM ri
		where ri.ChulpanReestr = $1
	);
END $$
language plpgsql stable;