【问题标题】:Encountered the symbol?遇到符号?
【发布时间】:2015-08-20 07:39:57
【问题描述】:
CREATE OR REPLACE FUNCTION F5
  (tstg IN stage.numerostage%type) 
     return  sys-ryfcursor
DECLARE
BEGIN
    OPEN list for 
      SELECT count(*) as nbrmodule,sess.* 
     from session sess natural join enseigne  
     where numerostage=tstg;  
    RETURN list;        
END;

我收到此错误:

遇到符号

【问题讨论】:

  • 如果您发布完整版本,您的错误消息可能会得到改进。
  • 数据库是?选择一个。
  • @user_0 你是什么意思?
  • @thuglife,对不起,我的错误

标签: sql oracle plsql oracle11g oracle10g


【解决方案1】:

您的函数中有多个错误

sys-ryfcursor

我是SYS_REFCURSOR

声明

您不需要DECLARE 关键字。删除它。

建议,始终编译您的代码并在 SQL*Plus 或类似客户端中使用 SHOW ERRORS 来查看完整错误堆栈

例如,

SQL> CREATE OR REPLACE
  2    FUNCTION F5(
  3        tstg   IN stage.numerostage%type)
  4      RETURN SYS-ryfcursor
  5      DECLARE
  6      BEGIN
  7        OPEN list FOR SELECT COUNT(*)
  8      AS
  9        nbrmodule,sess.* FROM session sess NATURAL JOIN enseigne WHERE numerostage=tstg;
 10        RETURN list;
 11      END;
 12      /

Warning: Function created with compilation errors.

SQL> sho err
Errors for FUNCTION F5:

LINE/COL ERROR
-------- -----------------------------------------------------------------
3/15     PLS-00103: Encountered the symbol "-" when expecting one of the
         following:
         . @ % ; is authid as cluster order using external character
         deterministic parallel_enable pipelined aggregate
         result_cache accessible

SQL>

【讨论】:

  • @thuglife 然后编辑您的问题并复制粘贴您的会话,就像我向您展示的那样。
猜你喜欢
  • 2013-10-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-11-26
  • 2018-01-23
  • 2016-11-05
  • 1970-01-01
相关资源
最近更新 更多