F A few years back, I created a view generator with support for JOINs. Unfortunately, it did not work for many use cases. It was bothering me for a while, so I decided to fix it. You list several tables with your preferred aliases, and it will find foreign keys between the tables (both ways) and apply them to the previous tables. So the table order is critical. I tried to adjust the table order based on the constraints, but that proved to be a bit challenging, so at least for now you have to figure out the table order yourself. Also, if you have columns with the same name, the later ones will be commented out. DECLARE in_tables CONSTANT VARCHAR2(4000) := ' TABLE_NAME1 t1, TABLE_NAME2 t2, TABLE_NAME3 t3, '; in_ignore_cols CONSTANT VARCHAR2(4000) := 'CREATED_BY,CREATED_AT,UPDATED_BY,UPDATED_AT,'; -- v_tables VAR...
A At times, I need to manage a long list of options; therefore, the logical approach is to organize them into groups rather than having everything in a single list. However, this approach introduces several challenges. Previously I just added another LOV item just with groups, but with multiple items you will quickly clutter your UI. The groups are sorted alphabetically. So if you want a different order, you have to use this neat trick, which add spaces at the start of your group name, and hence it gets sorted as you wish: SELECT NVL(g.group_name, INITCAP(g.group_code)) AS group_name, -- LPAD(' ', ROW_NUMBER() OVER ( -- reverse r# for proper grouping sets sorting hack ORDER BY g.order# DESC NULLS FIRST, g.group_code DESC ), ' ') || NVL(g.group_name, INITCAP(g.group_code)) AS group_name__, -- groups sorted, use in LOV as group -- ROW_NUMBER() OVER ( ORDER BY ...