ALTER FUNCTION "DBA"."get_eak_eakchannel"( in a_asutnr integer )
RETURNS char(20)
BEGIN
  declare ls_return char(20);
  declare li_eak smallint;
  if a_asutnr>0 then
    select asulist.eakchannel into li_eak from asulist where asulist.asutnr=a_asutnr
  end if;
  if li_eak=1 then
    set ls_return='INTERNET_BANK'
  elseif li_eak=2 then
    set ls_return='POST'
  elseif li_eak=3 or li_eak=5 then
    set ls_return='EMAIL'
  elseif li_eak=4 then
    set ls_return='PORTAL'
  else
    set ls_return=''
  end if;
  return ls_return;
END