Cursor 内的 Oracle 分析

发布于 2024-07-27 17:24:59 字数 595 浏览 5 评论 0原文

我想知道为什么 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

堇年纸鸢 2024-08-03 17:24:59

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.

沉睡月亮 2024-08-03 17:24:59

您可以在 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文