CREATE FUNCTION "DBA"."if_exists_pa_kaader"( in a_asutnr integer )
RETURNS INTEGER
BEGIN
  DECLARE ll_return INTEGER;
  if exists( select 1 from pa_kaader where asutnr=a_asutnr) then
    set ll_return=1
  else
    set ll_return=0
  end if;
  RETURN ll_return;
END