oracle 在另一个块中进入查询模式之前清除一个块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26904643/
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
Clearing one block before entering query mode in another
提问by Milan Stojkovi?
Before I ask my question, I have to say that the database that I'm working on doesn't have foreign keys, so I can't make master-detail blocks, and because of that I'm using workaround with go_block, clear_block, execute_query and triggers.
在我问我的问题之前,我不得不说我正在处理的数据库没有外键,所以我不能制作主从块,因此我正在使用 go_block、clear_block 的解决方法、execute_query 和触发器。
I have a form with two blocks. If we presume that the both blocks are filled with info, and that I want to execute query on first one, is there a way to clear the other block before entering query mode?
我有一个包含两个块的表单。如果我们假设两个块都填充了信息,并且我想在第一个块上执行查询,有没有办法在进入查询模式之前清除另一个块?
e.g.
Block1: ID, NAME, SURNAME
Block2: INFO1, INFO2, ..., Id_block1 etc.
So, if there is info on both blocks, and I enter the query mode on Block1, whole block clears so I can enter search criteria, but the second block still has the data from the last executed query. Is there a way to clear the data on the second block as well? Once again, I want to clear the data from Block2 when I'm IN ENTER-QUERY MODE on Block1.
因此,如果两个块都有信息,并且我在 Block1 上进入查询模式,则整个块将清除,以便我可以输入搜索条件,但第二个块仍具有上次执行查询的数据。有没有办法清除第二个块上的数据?再一次,当我在 Block1 上处于输入查询模式时,我想清除 Block2 中的数据。
Workflow: Enter-query mode Block1, execute-query Block1, NEW-RECORD-INSTANCE trigger activates (where workflow continues), go_block('Block2'), execute_query on Block2 (with where clause Id_block1 = block1.id).
I'm using Oracle Forms 10g. I appreciate any help you can provide.
我正在使用 Oracle Forms 10g。感谢您提供的任何帮助。
回答by Aakanksha Shah
It is possible to create the MASTER-DETAIL relationship while creating one of the blocks in your form
or
you can just write the following on the KEY-ENTQRY trigger :
可以在创建表单中的块之一时创建 MASTER-DETAIL 关系,
或者
您可以在 KEY-ENTQRY 触发器上写下以下内容:
go_block('block2');
clear_block;
go_block('block1');
enter_query;
After this, the block1 will be in the enter-query mode and you can search the data and just execute the block.
此后,block1 将处于enter-query 模式,您可以搜索数据并执行block。