2015-06-05 50 views
-8
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; 

我得到這個錯誤:遇到符號?

encountered the symbol

+2

你的錯誤信息可能會得到改善。 – TZHX

+0

而db是?選一個。 –

+0

@ user_0你是什麼意思? –

回答

1

有多種錯誤功能

sys-ryfcursor

這是SYS_REFCURSOR

DECLARE

您不需要DECLARE關鍵字。去掉它。

的建議,總是編譯你的代碼,並使用SHOW錯誤的SQL * Plus或類似的客戶端看到完整的錯誤堆棧。如果您發佈它的完整版

例如,

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> 
+0

我刪除它宣佈,但錯誤再次@Lalit庫馬爾B –

+0

@thuglife然後編輯你的問題,複製粘貼你的會議,就像我已經告訴你。 –

相關問題