- Written by Erwin
- Category: Oracle
- Published: 03 December 2014
- Hits: 1374
You have a master-detail table relationship and you want to filter the detail rows, programmatically or any other way.
In a jDeveloper - Oracle database environment [View object (master) - View link - View object (detail)]
With jDeveloper you have some options, maybe even more than mentioned here.
Here are some solutions. Choose the best solution in your case.
1. database view
Create a new detail view object based on a database view. Easy solution, easy to maintain in case of where clause adjustments, but a pretty static solution. A view change is necessary when the condition changes.
2. view criteria
Create a view criteria (named or programmatically). That's pretty dynamic.
You can programmatically control the view criteria you want to use.
3. where clause
Add a where clause to the detail view object. Like option 1, pretty static, but with the use of bind variables you have a nice solution. Furthermore, you can also add a where clause programmatically.
4. while loop
Not the best solution, but you can just loop through the detail values and select the rows you need. Personally, I don't like it, especially when a lot of rows are involved and you only want to display a few rows.
5. search criteria
It depends on what the problem is and what the customer wants, but you can also choose to add search items above your detail page. This way the user can filter the data.
Choose one. Consider the fastest (performance) and easy to maintain.