Search code examples
databaseoracle-databasedesigner

Custom query which returns to data block output in Oracle Forms Builder?


I have these tables

BOOKS

ID | GENREID(number) | COUNTRYID(number) |

GENRES

ID | TITLE

COUNTRIES

ID | TITLE

In my form BOOKS, I need to display:

ID GENERES.TITLE COUNTRIES.TITLE

All I need is to JOIN tables or SELECT data from all tables and display it. It seems that this is impossible with Oracle forms designer. My data block output displays data from the BOOKS table with inserted ids, but not with titles corresponding to those ids from separate tables (e.g. GENRES, COUNTRIES). I can't find where to put a custom query to data block.

I am using latest oracle dev suite home. How do I do this?


Solution

  • There's two common ways to do this:

    • Use a post-query trigger to populate non-database display fields and an LOV to allow them to insert and update those fields.

    • Create a view in the database and base your block on that.

    The first one is the easiest but they won't be able to search on those non-database fields without a lot of extra work.

    The second option allows search but adding and updating data in a view introduces some problems. I usually use an on-insert, on-update, on-delete, and on-lock trigger to handle those function manually and modify the base tables.