0
votes

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.

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.

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.

1
Although it's highly recommended to add a referential integrity constraint, you can still make a master-detail block relationship in Forms without one. When adding the detail block, and the Create Relationship dialog comes up, uncheck "Auto-join data blocks" and then manually enter the join criteria. - Jeffrey Kemp
Right, as @JeffreyKemp said, you can do a master-detail relationship without having the foreign key relationship in place. - GriffeyDog

1 Answers

1
votes

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 :

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.