CREATE FUNCTION "DBA"."if_exists_partlist"( in a_kood char(16) )
RETURNS smallint
BEGIN
  declare li_return smallint;
  if exists(select 1 from partlist where part="left"(a_kood+space(16),16)) then
    set li_return=1
  else
    set li_return=0
  end if;
  return li_return;
END