`
sunxboy
  • 浏览: 2869947 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

怎样在Form block中实现Group by---一篇不错的文章(转)

阅读更多
怎样在Form block中实现Group by---一篇不错的文章

Problem Description:
====================

In Oracle Forms, you define a GROUP BY clause for a block
by setting the WHERE Clause or ORDER BY Clause block property.

You run the form.
When you try to execute a query, the following error occurs:

FRM-40505: ORACLE error: unable to perform query.

When you select Help-->Display error, one of the following errors displays:

Error 1: without setting WHERE or ORDER BY clause
-------------------------------------------------
SELECT <column1, column2, etc.>,ROWID FROM TABLE
WHERE GROUP BY <column1, column2, etc.>
or
SELECT <column1, column2, etc.>,ROWID FROM TABLE
WHERE GROUP BY <*subset* of column1, column2, etc.>
or
SELECT <column1, column2, etc.>,ROWID FROM TABLE
ORDER BY GROUP BY <column1, column2, etc.>
or
SELECT <column1, column2, etc.>,ROWID FROM TABLE
ORDER BY GROUP BY <*subset* of column1, column2, etc.>
and
ORA-00936: missing expression


Error 2: ORDER BY Clause lists a column
---------------------------------------
SELECT <column1, column2, etc.>,ROWID FROM TABLE
ORDER BY <column> GROUP BY <column1, column2, etc.>
or
SELECT <column1, column2, etc.>,ROWID FROM TABLE
ORDER BY <column> GROUP BY <*subset* of column1, column2, etc.>
and
ORA-00933: SQL command not properly ended


Error 3: WHERE Clause has a condition and
you GROUP BY a subset of columns in the SELECT list
------------------------------------------------------------
SELECT <column1, column2, etc.>,ROWID FROM TABLE
WHERE <condition> GROUP BY <*subset* of column1, column2, etc.>
and
ORA-00979: not a GROUP BY expression


How do you specify a GROUP BY clause for a block in Oracle Forms?

Solution Description:
=====================

To query a block with a GROUP BY clause, do the following:

1. Specify the GROUP BY clause in the WHERE Clause block property.

Error 1
-------
ORA-00936 occurs when you specify only a GROUP BY clause
in either the WHERE Clause or ORDER BY Clause block property.
Oracle Forms automatically inserts the word WHERE into the
SQL statement when you set the WHERE Clause block property and
the word ORDER BY when you set the ORDER BY Clause block property.
The construction of the SQL statement is invalid with the presence of
WHERE GROUP BY or ORDER BY GROUP BY.

Workaround:
In the WHERE Clause block property, precede the GROUP BY clause
with a dummy WHERE condition (e.g. 1=1):
1=1 GROUP BY <column1, column2, etc.>


Error 2
-------
ORA-00933 occurs because the GROUP BY clause must precede the
ORDER BY clause. Hence, you cannot set the GROUP BY clause in the
ORDER BY Clause block property.


Error 3
-------
ORA-00979 occurs when you specify the GROUP BY clause in the
WHERE Clause block property and do not reference all columns
in the SELECT list in the GROUP BY clause. All columns in the
SELECT list that are not in group functions must be in the
GROUP BY clause.


2. Every SELECT statement issued by Oracle Forms contains a
pseudocolumn ROWID. Because all columns in the SELECT list
that are not in group functions must be in the GROUP BY clause,
ROWID must also be in the GROUP BY clause. However, because ROWID
is unique for every row, grouping by ROWID does not yield the
desired results.

Workaround:
To avoid grouping by ROWID, turn off the selection of ROWID:
a. Set the following block properties:
Key Mode: Non-Updateable
Primary Key: True (On)

Setting the Key Mode block property to Non-Updateable
eliminates the need for Oracle to use the ROWID as the
unique identifier for each row.

b. For at least one item in the block, set the following item property:
Primary Key: True (On)

Note: Oracle Forms 4.5.7.11.0 lets you get away with not
setting the above properties when specifying a dummy
WHERE condition and GROUP BY clause in the
WHERE Clause block property. ROWID does not end up in
the SELECT list despite the Key Mode property setting.
Other versions (e.g. 4.5.6.5.5, 4.5.7.1.6, 4.5.8.1.2)
require you to set the above properties.

3. When you use a GROUP BY clause in the WHERE Clause block property,
do not allow users to insert or update data in the block.

Run the form, and query the block.
This displays the grouped records.


Solution Explanation:
=====================

Oracle does not support modification of the WHERE Clause and ORDER BY Clause
block properties in non-standard ways. Refer to the WHERE/ORDER BY Clause
documentation in the Oracle Forms 4.X Reference Manual:

WHERE Clause and ORDER BY Clause are standard SQL clauses,
and must follow the rules for such constructs as specified
in the SQL Language Reference Manual.

Enhancement request 565914 for a GROUP BY Clause block property
in Forms has been filed.


Additional Information:
=======================

Oracle Documentation:
---------------------
Oracle Forms 4.X Reference Manual
Chapter 5, Properties
Key Mode, Primary Key (Block), Primary Key (Item), and
WHERE Clause/ORDER BY Clause

Oracle7 Server SQL Reference
Chapter 4, Commands
SELECT

Enhancement Request:
--------------------
565914
CREATE A GROUP BY CLAUSE BLOCK PROPERTY IN ORACLE FORMS
分享到:
评论

相关推荐

    源码解析之rc-field-form解读与实现

    在本文中,我们将深入探讨`rc-field-form`的核心概念、工作原理以及如何在实际项目中实现和使用它。 1. **核心概念** - **Field**: `rc-field-form`中的基本单位,它封装了输入组件,负责状态管理和验证。 - **...

    feign-form-spring-3.8.0-API文档-中文版.zip

    赠送jar包:feign-form-spring-3.8.0.jar; 赠送原API文档:feign-form-spring-3.8.0-javadoc.jar; 赠送源代码:feign-form-spring-3.8.0-sources.jar; 赠送Maven依赖信息文件:feign-form-spring-3.8.0.pom; ...

    feign-form-3.8.0-API文档-中文版.zip

    赠送jar包:feign-form-3.8.0.jar; 赠送原API文档:feign-form-3.8.0-javadoc.jar; 赠送源代码:feign-form-3.8.0-sources.jar; 赠送Maven依赖信息文件:feign-form-3.8.0.pom; 包含翻译后的API文档:feign-form...

    基于form-data请求格式详解

    在实际开发中,form-data请求格式不仅适用于文件上传,还可以用于任何二进制数据的上传。它的主要优势在于能够以一种结构化的格式发送多个部分的数据,包括文本和二进制内容,非常适合需要上传复杂数据的Web应用程序...

    form-generator项目集成方案.doc

    form-generator项目集成方案是指将form-generator项目集成到本地项目中,以便实现表单可视化设计和生成表单代码的功能。该方案主要涉及到 Vue 项目的多页面结构、组件引入、样式文件复制、npm安装等几个方面。 多...

    ajax-axios-url-form-serialize 插件

    在Web开发中,数据交互是不可或缺的一部分,而Ajax技术正是实现页面异步更新的关键。随着前端框架的不断发展,像Vue.js这样的库广泛使用,Axios作为一款强大的HTTP客户端,已经成为Vue生态系统中的重要组成部分。在...

    Oracle Form 触发器的执行顺序

    Oracle Form 是 Oracle E-Business Suite R12 中的一个功能强大且灵活的开发工具,用于创建复杂的商业应用程序。其中,触发器(Trigger)是一种非常重要的组件,它可以根据不同的事件来触发相应的操作。 Oracle ...

    关于applicationx-www-form-urlencoded等字符编码的解释说明

    multipart/form-data是另一种常用的编码格式,它将窗体数据编码为一条消息,页上的每个控件对应消息中的一个部分。这种编码格式可以上传文件,并且可以处理复杂的数据结构。 在实际开发中,我们需要根据具体情况...

    form-generator 表单设计

    Element UI表单设计,将生成的代码直接运行在基于Element的vue项目中,也可导出JSON表单,使用配套的解析器将JSON解析成真实的表单。 npm i form-gen-parser@1.0.3 npm install clipboard@2.0.4 --save npm install ...

    C#使用multipart/form-data示例

    在IT行业中,网络通信是不可或缺的一部分,而上传文件或发送包含多个部分的数据通常涉及使用`multipart/form-data`编码方式。`multipart/form-data`是一种HTTP请求的Content-Type,它允许我们发送一个请求体,其中...

    feign-form-spring-3.8.0-API文档-中英对照版.zip

    赠送jar包:feign-form-spring-3.8.0.jar; 赠送原API文档:feign-form-spring-3.8.0-javadoc.jar; 赠送源代码:feign-form-spring-3.8.0-sources.jar; 赠送Maven依赖信息文件:feign-form-spring-3.8.0.pom; ...

    k-form-design表单设计器 v3.8.18.zip

    《k-form-design表单设计器 v3.8.18》是一款强大的前端表单构建工具,专为提升开发效率而设计。这款开源软件允许开发者快速、灵活地创建自定义表单,适应各种业务需求,尤其适合于系统软件工具的构建和建站模板的...

    Delphi7 multipart/form-data实现上传文件

    本教程将深入讲解如何利用 Indy 10 库中的 `TIdHTTP` 控件来实现这一功能。 首先,你需要确保已经安装了Indy 10库,这是一个强大的网络通信组件集,包含了处理HTTP请求所需的各种组件。在Delphi 7中,你可以通过...

    c#实现HttpClient拼接multipart/form-data形式参数post提交数据

    使用c#实现的HttpClient拼接multipart/form-data形式参数post提交数据,包含图片内容,有需要的可以下载,希望能帮到有需要的人,

    用C语言编写multipart/form-data实现上传文件

    用C语言实现multipart/form-data文件上传,没有用到curl之类的库。之前做个小的日志上传程序写的。

    vue-ele-form-generator可视化表单设计工具 v3.1.0.zip

    在毕业设计论文中,"vue-ele-form-generator"可以作为一个实际应用案例,用于探讨前端开发中的动态表单生成技术,或者研究如何通过可视化工具提高软件开发效率。学生可以分析其架构设计,探讨组件化、模块化的实现...

    使用JQuery实现从JSON对象转换为form提交数据

    本篇文章将深入探讨如何利用jQuery从JSON对象转换为form提交数据。 首先,JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,它基于JavaScript的一个子集,易于人阅读和编写,同时也易于机器解析和...

    一个基于C#实现的通用Win-Form/Web-Form 组件类库及程序例子代码

    总的来说,这个资源对于那些希望在Win-Form和Web-Form项目中实现一致界面的C#开发者来说,是一份宝贵的工具。通过使用它,开发者可以减少重复工作,提高代码质量,并且能够专注于业务逻辑的实现,而不是基础界面组件...

Global site tag (gtag.js) - Google Analytics