返回到 Oracle Forms Builder 中数据块输出的自定义查询?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4483477/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 22:14:27  来源:igfitidea点击:

Custom query which returns to data block output in Oracle Forms Builder?

databaseoracledesigner

提问by Brudas

I have these tables

我有这些桌子

BOOKS

图书

ID | GENREID(number) | COUNTRYID(number) |

GENRES

流派

ID | TITLE

COUNTRIES

国家

ID | TITLE

In my form BOOKS, I need to display:

在我的表单书籍中,我需要显示:

ID GENERES.TITLE COUNTRIES.TITLE

All I need is to JOIN tables or SELECT data from all tables and display it. It seems that this is impossible with Oracle forms designer. My data block output displays data from the BOOKS table with inserted ids, but not with titles corresponding to those ids from separate tables (e.g. GENRES, COUNTRIES). I can't find where to put a custom query to data block.

我所需要的只是连接表或从所有表中选择数据并显示它。对于 Oracle 表单设计器,这似乎是不可能的。我的数据块输出显示来自 BOOKS 表的数据,其中插入了 id,但不显示与来自单独表(例如,GENRES、COUNTRIES)的那些 id 相对应的标题。我找不到将自定义查询放置到数据块的位置。

I am using latest oracle dev suite home. How do I do this?

我正在使用最新的 oracle 开发套件主页。我该怎么做呢?

回答by JOTN

There's two common ways to do this:

有两种常见的方法可以做到这一点:

  • Use a post-query trigger to populate non-database display fields and an LOV to allow them to insert and update those fields.

  • Create a view in the database and base your block on that.

  • 使用查询后触发器填充非数据库显示字段和 LOV 以允许它们插入和更新这些字段。

  • 在数据库中创建一个视图并以此为基础创建块。

The first one is the easiest but they won't be able to search on those non-database fields without a lot of extra work.

第一个是最简单的,但如果没有大量额外的工作,他们将无法搜索那些非数据库字段。

The second option allows search but adding and updating data in a view introduces some problems. I usually use an on-insert, on-update, on-delete, and on-lock trigger to handle those function manually and modify the base tables.

第二个选项允许搜索,但在视图中添加和更新数据会带来一些问题。我通常使用 on-insert、on-update、on-delete 和 on-lock 触发器来手动处理这些功能并修改基表。

回答by Jokke Heikkil?

http://sheikyerbouti.developpez.com/from_clause/from_clause.htm

http://sheikyerbouti.developpez.com/from_clause/from_clause.htm

--> Read the Step 3

--> 阅读第 3 步

I'm using that one a lot. With that you can build your own queries to Forms and also get block which you can insert/update/delete (of course to one table). And this is how I for example do block which has like user id and user name fields.

我经常使用那个。有了它,您可以构建自己的表单查询,也可以获取可以插入/更新/删除(当然是一张表)的块。例如,这就是我如何阻止具有用户 ID 和用户名字段的块。

But at least in my Forms version it's not possible to change query in run time because it's changing data_source_type back to default.

但至少在我的 Forms 版本中,不可能在运行时更改查询,因为它将 data_source_type 更改回默认值。