ALTER FUNCTION "dba"."get_ls_maksud_def"( in a_id integer )
RETURNS char(200)
BEGIN
  DECLARE ls_return char(200);
  select Left(get_asulist_nimi_quick(ls_laps.asutnr)+'  '+get_asulist_nimi_quick(ls_laps.saajanr)+'  '+ls_makslist.nimi,200)
    into ls_return
    from ls_maksud left outer join ls_laps on ls_maksud.lapsnr=ls_laps.lapsnr
                   left outer join ls_makslist on ls_maksud.maksnr=ls_makslist.maksnr
    where ls_maksud.id=a_id;
  RETURN ls_return;
END