CREATE FUNCTION "DBA"."if_exists_dk_kanne_earve"( in a_id_earve integer )
RETURNS INTEGER
BEGIN
  DECLARE li_return INTEGER;
  set li_return=0;
  if a_id_earve>0 then
    if exists(select 1 from "dk_kanne" where "dk_kanne"."id_earve"=a_id_earve) then
      set li_return=1
    else
     set li_return=0
    end if
  end if;
  RETURN li_return;
END