CREATE FUNCTION "DBA"."if_exists_dk_costreport_costreportid"( in a_costreportid char(100) )
RETURNS INTEGER
BEGIN
	DECLARE li_return INTEGER;
    if a_costreportid is null or Length(Trim(a_costreportid))=0 then
      set li_return=-1;
    else
      if exists(select 1 from "dk_costreport" where "dk_costreport"."costreportid"=a_costreportid) then
        set li_return=1
      else
        set li_return=0
      end if
    end if;
	RETURN li_return;
END