Oracle создать функцию не удается - PullRequest
1 голос
/ 31 марта 2011

Может кто-нибудь сказать мне, почему приведенная ниже функция не может скомпилироваться?

CREATE or replace FUNCTION CONCAT_LIST
      (cur IN SYS_REFCURSOR, sep IN VARCHAR2) 
    RETURN  VARCHAR2
IS 
  ret VARCHAR2(32000); 
  tmp VARCHAR2(4000); 
BEGIN 
    --open cur;
    loop 
      fetch cur into tmp; 
      exit when cur%NOTFOUND;
      if ret is null then
       ret := tmp; 
      else 
        ret := ret || sep || tmp; 
      end if;
    end loop; 
    RETURN ret;
  END;

Полученное сообщение об ошибке:

 PLS-00103: Encountered the symbol " " when expecting one of the following:
 <an identifier> <a double-quoted delimited-identifier> SELF_
 LONG_ double ref char time timestamp interval date binary
 national character nchar
...