CREATE OR REPLACE FUNCTION food600.opatovnamigracia(
	muzaverka character,
	mcuzaverka integer,
	mcdata integer)
    RETURNS void
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE 
AS $BODY$
DECLARE vysledok INTEGER DEFAULT 0;
BEGIN
DELETE FROM food600.sk__pol where c_uzaverka=mcuzaverka and c_data=mcdata;
DELETE FROM food600.sk__plt where c_uzaverka=mcuzaverka and c_data=mcdata;
DELETE FROM food600.sk__fin where c_uzaverka=mcuzaverka and c_data=mcdata;
DELETE FROM food600.sk__txt where c_uzaverka=mcuzaverka and c_data=mcdata;
SELECT food600.sk__on(muzaverka, mcuzaverka, mcdata) INTO vysledok;
END
$BODY$;
