Using the above in-line view SQL statement, you would typically create a Forms data block based on the HR.EMPLOYEES table and then use the EMPLOYEES block Post-Query trigger to fetch the department_name and manager_name. The Forms “From Clause” query is the perfect solution and is easier to implement and is more efficient than building a form based on the primary table in a join and then using the block Post-Query trigger to retrieve the needed values from related tables and the From Clause query. So you may still be asking yourself “Why would I want to use this in a form?” The most common answer is when you want to base a form on a result set, but you don’t have privileges to create a view in the database or where creation of database objects if closely controlled and your request for the creation of a view would likely be denied. ,m.last_name || ', ' || m.first_name AS manager_nameįROM employees e, DEPARTMENTS d, EMPLOYEES m Here is a basic example using SQL (based on the HR demo schema):įROM ( SELECT e.last_name || ', ' || e.first_name AS name
The query that produces a result set is referenced through the FROM clause of a query – hence the name “From Clause” query. What is a From Clause anyway? Basically, a From Clause query in Forms is the same as an In-Line View in SQL which enables you to select columns from a result set.
#How to use trigger block in blocksworld how to
If you are like most Forms developers, you probably haven’t used this method because you were never shown how to use them or you didn’t understand the circumstances of when it would be appropriate to use this method. If you have worked Oracle Forms for any amount of time, you will eventually hear about basing a block on a From Clause query.