CREATE OR REPLACE FUNCTION food600.getidstravmaster(
	idstrav integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE
AS $BODY$
DECLARE idstravmaster INTEGER;
BEGIN
SELECT id_strav_master INTO idstravmaster FROM food600.nlimitstravnici WHERE id_strav=idstrav;
RETURN btrim(idstravmaster::character(20));
END
$BODY$;
