CREATE FUNCTION "DBA"."if_exists_partlist_id"( in a_id integer )
RETURNS INTEGER
BEGIN
  declare li_return integer;
  if exists(select 1 from partlist where partnr=a_id) then
    set li_return=1
  else
    set li_return=0
  end if;
  return li_return;
end