CREATE OR REPLACE FUNCTION dm_iif(v_feltetel boolean, v_igaz_ertek integer, v_hamis_ertek integer)
  RETURNS integer AS
'declare

v_eredmeny integer;

-- IF egysorban

begin
   IF v_feltetel THEN
      v_eredmeny = v_igaz_ertek;
   ELSE
      v_eredmeny = v_hamis_ertek;
   END IF;

   return v_eredmeny;
end;
'
  LANGUAGE plpgsql VOLATILE;