问题描述
我需要一些建议,如何在选择子查询或创建视图中使用内联函数,据我所知,在oracle 12c中是可能的。
代码:
错误:
提前感谢
代码:
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<> or != or ~= >= <= <> and or like like2 like4 likec between || member submultiset 06553. 00000 - "PLS-%s: %s" *Cause: *Action: Error at Line: 4 Column: 1
提前感谢
专家解答
如果您只是有一个简单的SQL查询,请将where子句放在顶部:
如果您使用的是插入、更新、删除或合并,您只需要/* with_plsql */提示。
with function calculator (m number, r number) return number is begin return m * r; end calculator; select calculator(3, 2) as calc from dual; CALC 6
如果您使用的是插入、更新、删除或合并,您只需要/* with_plsql */提示。
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




