CREATE OR REPLACE FUNCTION food600.getidptypkslave(
	idptypkmaster integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'

    COST 100
    VOLATILE 
    
AS $BODY$
DECLARE 
idptypk INTEGER;
BEGIN
SELECT idriadok INTO idptypk FROM kredit.hk_ptypk WHERE idriadok_master=idptypkmaster;
RETURN btrim(idptypk::character(20));
END;
$BODY$;
