Oracle Forms: how to clear a block when the query ends

Viewed 36

I have created an oracle form where 2 tables are connected and each table has his own block. The problem is when I run the query and it shows results in both blocks its all good.. but when I go to the next item in the query and then the next and then at the end the data ends and the first block just goes to blank cause there is no more data to collect, but the second block will clear everything except the field where the connection between the 2 tables exists.. How to clear that field!

1 Answers

Layout you described looks like a master-detail relationship.

If so, you should have used the Data Block Wizard to create master data block first, and then detail data block. The Wizard leads you through the process.

At the end, number of PL/SQL procedures is created which makes everything work smoothly.


It means that - once you navigate to the last record in the master block - its details are displayed in the detail block.

When you navigate behind that last record, as there's no matching record in the detail block, it (the detail block) is left empty. It just can't display any value which is used to establish master-detail relationship between these two blocks as there's no master record either.


Therefore: if you wrote your own code to establish master-detail relationship, either review what you did and fix what's wrong, or remove everything (program code, not blocks themselves) and use Data Block Wizard which will do it right.

Related