2017-04-11 62 views
1

我需要一些建議,如何在select子查詢或創建視圖中使用內聯函數。我的代碼給了我下面的錯誤。選擇子查詢或創建視圖中的內聯函數

我用這link和最後的解決方案建議正是我也試圖做的。

代碼:

select /*+ WITH_PLSQL */ calc from 
(
with 
function calculator (m number, r number) return number 
is begin 
return m * r; 
end calculator; 
select calculator(3, 2) as calc from dual 
); 

錯誤:

ORA-06553: PLS-103: Encountered the symbol "end-of-file" when expecting one of the following: 

    . (* @ % & = - + ; </> at in is mod remainder not rem 
    <an exponent (**)> <> or != or ~= >= <= <> and or like like2 
    like4 likec between || member submultiset 
06553. 00000 - "PLS-%s: %s" 
*Cause:  
*Action: 
Error at Line: 4 Column: 1 

在此先感謝

+0

請詳細說明您的要求。 – user75ponic

+0

@ user75ponic,點是我創建了這個內聯'與函數',我想從代碼中顯示的這個函數中選擇數據..但我收到上述錯誤 –

+0

我可以在12c中重現此錯誤。所以,這很有趣。 – APC

回答

0

我張貼在AskTOM這個問題,你可以看到整個討論帖在下面的鏈接:Solution for above issue

問題出在SQL開發人員,在SQLPlus這個查詢工作正常。