2017-04-11 39 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这个查询工作正常。