CREATE FUNCTION "dba"."get_pv_kanne_muuinfo_id"( in a_yldnimi char(200) )
RETURNS INTEGER
BEGIN
  declare ll_id integer;
  select first "id" into ll_id from pv_kanne_muuinfo where Trim(yldnimi)=a_yldnimi;
  if ll_id is null then
    set ll_id=0;
  end if;
  return ll_id;
END