Each data block has an associated data source. Action by the application or by the end user can cause Oracle Forms to issue a query to the data source. The following paragraphs describe the way Oracle Forms constructs and processes queries.
Properties of the data block and of its base table items define the SQL SELECT statement that Oracle Forms executes in the absence of additional commands. Oracle Forms sets most of these properties automatically. The application designer can set the following properties:
The application can also use Built-ins to set properties at runtime.
At runtime, end users can initiate queries by a two-step process:
The application can modify the example record that the end user creates, or it can create an example record without end user action. Oracle Forms combines the example record with the previously established block properties to produce the query it issues to the database.
Oracle Forms performs the following steps to create a SELECT statement to issue to the database:
Oracle Forms reinitializes the example record whenever a program statement, menu selection, or function key causes Oracle Forms to execute any of the ENTER_QUERY, EXECUTE_QUERY, or COUNT_QUERY Built-ins or to enter one of the corresponding interactive modes.
Designers can assign values to items in a PRE-QUERY trigger. Note that changes made to the SELECT statement by a PRE-QUERY trigger override values entered by an end user in Enter Query mode. This functionality allows the designer to screen illegal queries.
End users can invoke the Query Where dialog box by entering a colon in a field in Enter Query mode. This allows them to supply values for the WHERE clause by entering query conditions, using pattern matching and relational operators.
When a form is in Enter Query mode, Oracle Forms modifies its processing rules as follows:
Block Menu |
Next Block |
Clear Form/Rollback |
Next Record |
Commit |
Next Set of Records |
Down |
Previous Block |
Duplicate Item |
Previous Record |
Duplicate Record |
Scroll Down |
Insert Record |
Scroll Up |
Lock Record |
Up |