Cursor 内的 Oracle 分析
我想知道为什么 Oracle Forms 中“光标”内的“分析”行会生成错误。 它是这样写的:
CURSOR READ_C1_REC IS
SELECT DISTINCT MACH, TCODE,
COUNT(ALL TRANS_NO) OVER (PARTITION BY MACH,
TCODE ORDER BY MACH, TCODE) TOTALPERMACHPERTCODE
FROM
(
SELECT ....
)
ORDER BY MACH, TCODE;
C1_REC READ_C1_REC%ROWTYPE;
...这是编译期间的错误消息:
Error 103 at line 17, column 29
Encountered the symbol "(" when expecting one of the following:
, from
...并且错误指向分析中“OVER”一词之后的部分。
我的代码可能有什么问题? “光标”内是否允许进行分析?
:)
I'm wondering why my "analytics" line inside a "cursor" in Oracle Forms generates an error. This is how it's written:
CURSOR READ_C1_REC IS
SELECT DISTINCT MACH, TCODE,
COUNT(ALL TRANS_NO) OVER (PARTITION BY MACH,
TCODE ORDER BY MACH, TCODE) TOTALPERMACHPERTCODE
FROM
(
SELECT ....
)
ORDER BY MACH, TCODE;
C1_REC READ_C1_REC%ROWTYPE;
...and this is the error message during compilation:
Error 103 at line 17, column 29
Encountered the symbol "(" when expecting one of the following:
, from
..and the error points to the part after the word "OVER" in the analytics.
What could be wrong with my code? Is analytics allowed inside a "cursor"?
:)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Oracle Forms 拥有(或至少曾经拥有)自己的 PL/SQL 引擎,但就其支持的功能而言,该引擎通常落后于数据库产品。 您的 Forms 版本可能有一个 PL/SQL 引擎,该引擎早于分析函数的引入。
你说过你不能创造观点; 你可以创建包吗? 如果是这样,也许您可以将代码移动到一个包中并从表单中调用它。
Oracle Forms has (or at least did at one time) its own PL/SQL engine, and this generally lags behind the database product in terms of the features it supports. It may be that your version of Forms has a PL/SQL engine that pre-dates the introduction of analytic functions.
You have said you cannot create views; can you create packages? If so perhaps you could move the code into a package and call it from Forms.
您可以在 Forms 中使用的 SQL 十多年来一直没有进步。
动态 SQL 是最好的答案。 我认为你应该看看 EXEC_SQL
The SQL you can use in Forms hasn't progressed in over a decade.
Dynamic SQL is the best answer. I think you should look at EXEC_SQL