Page 579
Triggers are procedures performed when a particular event occurs. A myriad of events can fire the trigger. The names of the triggers in Oracle Forms mirror the event that initiates them. This appendix describes the various available triggers.
Oracle Forms has nine different types of triggers. The types are discussed in the following bullet list. Each type also has a code that will be used in Table B.1 to denote the trigger type.n
Page 580
Triggers may also be defined at the form, block, or item level. You can determine the trigger's usage by looking for "FRM," "BLK," and "ITM" codes in the Usage or "USG" column. These codes mean Form, Block, and Item, respectively.
Some of the triggers may not be fired in the Query mode. This quality is contained by a value of "Yes" or "No" in the Query or "QRY" column.
Finally, triggers accept only certain commands. These are Select statements, restricted built_in subprograms, unrestricted built-in subprograms, PL/SQL, or data manipulation language (DML) commands. The appendix carries values of "SEL" (Select), "RES" (Restricted), "UNRES" (Unrestricted), "PL/SQ" (PL/SQL), "DML" (Data Manipulation Language), or "All" in the Restricted or "RES" column to denote these qualities. The "ALL" designation means that you can use all the commands.
Table B.1Valid Triggers and Trigger Characteristics
Name | TYP | USG | QRY | RES | Description |
Key-Clrblk | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Clear Block function key. This executes the clear_block built-in subprogram. Clears the current block of values. |
Page 581
Name | TYP | USG | QRY | RES | Description |
Key-Clrfrm | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Clear Form function key. This executes the clear_form built-in subprogram, which clears the current form of values. |
Key-Clrrec | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Clear Record function key. This executes the clear_record built-in subprogram, which clears the current record of values. |
Key-Commit | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Accept function key. This executes the commit built-in subprogram, which permanently saves the data changes. |
Key-Cquery | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the Count Query Hits function key. This executes the count_query built-in subprogram, which counts the number of records a query will return. |
Key-Crerec | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Insert Record function key. This executes the create_record built-in subprogram, which places the current record in the input mode. |
continues
Page 582
Table B.1 Continued
Name | TYP | USG | QRY | RES | Description |
Key-Delrec | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Delete Record function key. This executes the delete_record built-in subprogram, which removes the current record from the screen and marks the database record for permanent removal. |
Key-Down | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Down function key. This executes the down built-in subprogram, which navigates to the next record. |
Key-Dup-Item | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Duplicate Item function key. This executes the duplicate_item built-in subprogram, which copies the value from the same item in the previous record into the item in the current record. |
Key-Duprec | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Duplicate Record function key. This executes the duplicate_record built-in subprogram, which copies the values from the previous record into the current record. |
Page 583
Name | TYP | USG | QRY |
RES
| |
Key-Edit | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the Edit function key. This executes the edit_text_item built-in subprogram, which displays the item's defined text editor. |
Key-Entqry | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the Enter Query function key. This executes the enter_query built-in subprogram, which places the current block in the Enter Query mode. |
Key-Exeqry | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the Execute Query function key. This executes the execute_query built-in subprogram, which executes a database query and places the form in the Input mode. |
Key-Exit | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the EXIT function key. This executes the exit_form built-in subprogram, which closes the current form. When the form is in the input mode, this trigger places the block in the input mode. |
Key- [F0 .......F9] | K | FRMBLKITM | Yes | SELRESUNRES | Fires when the associated function key [F0, F1, F2, F3, F4, F5, F6, F7, F8, or F9] is pressed. |
continues
Page 584
Table B.1 Continued
Name | TYP | USG | QRY | RES | Description |
Key-Help | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the HELP function key. This executes the help built-in subprogram, which displays the current item's hint message. |
Key-Listval | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the List of Values function key. This executes the show_lov built-in subprogram, which displays this list of values for the current item. |
Key-Menu | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Block Menu function key. This executes the show_menu built-in subprogram, which displays the current menu. |
Key-Nxtblk | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Next Block function key. This executes the next_block built-in subprogram, which navigates to the next block in the form. |
Key-Nxt-Item | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the Next Item function key. This executes the next_item built-in subprogram, which navigates to the next item in the form. |
Key-Nxtkey | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Next Primary Key function key. This executes the next_key |
Page 585
Name | TYP | USG | QRY | RES | Description |
built-in subprogram, which navigates to the next item defined as a primary key. | |||||
Key-Nxtrec | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Next Record function key. This executes the next_record built-in subprogram, which navigates to the next record in the record buffer. |
Key-Nxtset | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Next Set Of Records function key. This executes the next_set built-in subprogram, which displays the next set of records from the record buffer. |
Key-Others | K | FRMBLKITM | Yes | SELRESUNRES | Fires when a function key not currently defined by the form or by Oracle is pressed. |
Key-Print | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the Print function key. This executes the print built-in subprogram, which screen prints the current form. |
Key-Prvblk | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Previous Block function key. This executes the previous_block built-in subprogram, which navigates to the previous block in the current form. |
continues
Page 586
Table B.1 Continued
Name | TYP | USG | QRY | RES | Description |
Key-Prv-Item | K | FRMBLKITM | Yes | SELRESUNRES | Simulates the pressing of the Previous Item function key. This executes the previous_item built-in subprogram, which navigates to the previous item in the form. |
Key-Prvrec | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Previous Record function key. This executes the previous_record built-in subprogram, which navigates to the previously displayed record in the record buffer. |
Key-Scrdown | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Scroll Down function key. This executes the scroll_down built-in subprogram, which displays the next set of records from the record buffer. |
Key-Scrup | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the Scroll Up function key. This executes the scroll_up built-in subprogram, which displays the previously displayed set of records from the record buffer. |
Key-Up | K | FRMBLKITM | No | SELRESUNRES | Simulates the pressing of the UP function key. This executes the up built-in subprograms, which display the |
Page 587
Name | TYP | USG | QRY | RES | Description |
previously displayed record from the record buffer. | |||||
Key-Updrec | K | FRMBLKITM | No | SELRESUNRES | Executes the lock_record built-in subprogram, which locks the form's associated database record. |
On-Check- Delete-Master | MD | FRMBLK | No | SELDMLUNRES | This trigger is created by Forms when multiple blocks are created. It fires when an attempt is made to delete a record from the master block. |
On-Check- Unique | T | FRMBLK | No | SELPL/ SQUNRES | This trigger fires previous to a database commit. It checks the database to ensure that values contained in items marked in Oracle Forms as primary keys do not exist in the associated database columns. |
On-Clear- Details | MD | FRMBLK | No | ALL | This trigger fires when an event occurs on the master block that dictates the need for form coordination. An example would be navigating to the next record. |
On-Close | T | FRM | No | SELPL/ SQUNRES | This trigger fires when the last record in a query has been displayed or the query has been aborted. |
continues
Page 588
Table B.1 Continued
Name | TYP | USG | QRY | RES | Description |
On-Column- Security | T | FRMBLK | No | SELPL/ SQUNRES | This trigger fires when Forms enforces column-level security. The block level Column Security property must be set to on. |
On-Commit | T | FRM | No | SELPL/ SQUNRES | This trigger fires when Oracle Forms attempts to commit records in the database. |
On-Count | T | FRMBLK | Yes | SELPL/ SQUNRES | This trigger fires when Oracle counts the number of rows that will be returned in a query. |
On-Delete | T | FRMBLK | No | SELDMLUNRES | This trigger fires when Oracle is marking the database record for delete. It fires after the Pre-Delete trigger and before the Post-Delete trigger. |
On-Error | MH | FRMBLKITM | Yes | SELUNRES | This trigger fires when Oracle Forms would display an error message. |
On-Fetch | T | FRMBLK | No | SELPL/ SQUNRES | This trigger is fired each time a record is fetched from the table to the form. |
On-Insert | T | FRMBLK | No | SELDMLUNRES | This trigger fires when Oracle inserts or adds a record to the database. |
Page 589
Name | TYP | USG | QRY | RES | Description |
On-Lock | T | FRMBLK | No | SELUNRES | This trigger fires when Oracle tries to lock a table record. This occurs when the user updates the first item on the form. |
On-Logon | T | FRM | No | UNRES | This trigger fires when the Form tries to connect to the database. |
On-Logout | T | FRM | No | SELUNRES | This trigger fires when the Form tries to break connection with the database. |
On-Message | MH | FRMBLKITM | Yes | SELUNRES | This trigger fires when the form displays a message. |
On-Populate- Details | MD | FRMBLK | No | SELPL/ SQUNRESRES | This trigger fires when the form needs to populate the detail block in a multiple block form. |
On-Rollback | T | FRM | No | SELPL/SQ | This trigger fires when a Rollback command is issued. |
On-Savepoint | T | FRM | No | SELPL/ SQUNRES | This trigger fires when a Savepoint command is issued. |
On-Select | T | FRMBLK | No | SELPL/ SQUNRES | This trigger fires when the Form tries to select records as a result of a query. |
On-Sequence- Number | T | FRMBLKITM | No | SELUNRES | This trigger fires when the Form attempts to generate the next number from a database sequence. |
continues
Page 590
Table B.1 Continued
Name | TYP | USG | QRY | RES | Description |
On-Update | T | FRMBLK | No | SELDMLUNRES | This trigger fires when the Form updates the database record. |
Post-Block | N | FRMBLK | No | SELUNRES | This trigger fires when you navigate from the current block. |
Post-Change | T | FRMBLKITM | No | SELUNRES | This trigger fires when Oracle determines the item was changed and is not null, a LOV item value is placed in the item, or a value is fetched into the item as a result of a query. |
Post-Database- Commit | T | FRM | No | SELDMLUNRES | This trigger fires after changes have been permanently commit- ted in the database. |
Post-Delete | T | FRMBLK | No | SELDMLUNRES | This trigger fires when the deleted record is permanently removed from the table by a commit. |
Post-Form | N | FRM | No | SELUNRES | This trigger fires when exiting a form. |
Post-Forms- Commit | T | FRM | No | SELDMLUNRES | This trigger fires after the form changes have been made in the database and before they are committed. |
Post-Insert | T | FRMBLK | No | SELDMLUNRES | This trigger fires after the record is added to the table during the commit phase. |
Post-Logon | T | FRM | No | SELUNRES | This trigger fires after connecting to the database or after a successful on-logon trigger execution. |
Page 591
Name | TYP | USG | QRY | RES | Description |
Post-Logout | T | FRM | No | SELUNRES | This trigger fires after the connection to the database is broken or after the on-logout trigger. |
Post-Query | QT | FRMBLK | No | SELUNRES | This trigger fires each time a record is fetched or returned to the form. |
Post-Record | N | FRMBLK | No | SELUNRES | This trigger fires whenever the input focus is moved to another record. |
Post-Select | T | FRMBLK | No | SELUNRES | This trigger fires after the selection phase of the query or upon successful performance of the extra trigger. |
Post-Text-Item | N | FRMBLKITM | No | SELUNRES | This trigger fires when the input focus leaves the current item. |
Post-Update | T | FRMBLK | No | SELDMLUNRES | This trigger fires when the record is updated and committed in the database. |
Pre-Block | N | FRMBLK | No | SELUNRES | This trigger fires prior to the cursor entering a new block. |
Pre-Commit | T | FRM | No | SELDMLUNRES | This trigger fires after Forms determines there are changes to process and they are processed. |
Pre-Delete | T | FRMBLK | No | SELDMLUNRES | This trigger fires before a row is deleted from the database. |
Pre-Form | N | FRM | No | SELUNRES | This trigger fires upon entry into the form, at the form startup. |
continues
Page 592
Table B.1 Continued
Name | TYP | USG | QRY | RES | Description |
Pre-Insert | T | FRMBLK | No | SELDMLUNRES | This trigger fires before a row is added to the database. |
Pre-Logon | T | FRM | No | SELUNRES | This trigger fires prior to attempting to connect to the database. |
Pre-Logout | T | FRM | No | SELUNRES | This trigger fires before disconnecting from the database. |
Pre-Query | QT | FRMBLK | No | SELUNRES | This trigger fires prior to Forms executing a query. |
Pre-Record | N | FRMBLK | No | SELUNRES | This trigger fires prior to navigation to another record. |
Pre-Select | T | FRMBLK | No | SELUNRES | This trigger fires before Forms executes the Select statement that performs the query. |
Pre-Text-Item | N | FRMBLKITM | No | SELUNRES | This trigger fires before the entry of the cursor into an item. |
Pre-Update | T | FRMBLK | No | SELDMLUNRES | This trigger fires prior to the update of a database record. |
User-Named | N | FRMBLKITM | No | All | This trigger fires when you call it explicitly from another trigger. |
When-Button- Pressed | I | FRMBLKITM | Yes | SELRESUNRES | This trigger is fired when the user clicks a button. |
When- Checkbox- Changed | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the user changes the state of the check box. |
Page 593
Name | TYP | USG | QRY | RES | Description |
When-Clear- Block | B | FRMBLK | Yes | SELUNRES | This trigger fires prior to Forms clearing the block of values. |
When-Create- Record | B | FRMBLK | No | SELUNRES | This trigger fires when Forms creates a new record. |
When-Custom- Item-Event | I | FRMBLKITM | Yes | UNRES | This trigger fires when Forms encounters an event sent from a custom item. |
When-Database- Record | B | FRMBLK | No | SELUNRES | This trigger fires when Forms marks a record for insert or update. |
When-Image- Activated | I | FRMBLKITM | No | SELUNRES | This trigger fires when the user double-clicks an image item. |
When-Image- Pressed | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the user single- or double-clicks on an image item. |
When-List- Activated | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the user displays a pick list. |
When-List- Changed | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the user selects a different item from a pick list. |
When-Mouse- Click | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the mouse is clicked |
When-Mouse- Doubleclick | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the mouse is double- clicked. |
When-Mouse- Down | I | FRMBLKITM | Yes | SELUNRESRES | This trigger fires when the mouse is de- pressed. |
When-Mouse- Enter | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the mouse enters an item or canvas. |
continues
Page 594
Table B.1 Continued
Name | TYP | USG | QRY | RES | Description |
When-Mouse- Leave | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the mouse leaves the item or canvas. |
When-Mouse- Move | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the mouse moves. |
When-Mouse- Up | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the operator releases the mouse button after it has been depressed. |
When-New- Block-Instance | N | FRMBLK | No | SELRESUNRES | This trigger fires when the cursor or input focus moves to an item in a different block. |
When-New- Form-Instance | N | FRM | No | SELRESUNRES | This trigger fires when the cursor enters the first navigable item as the form is first initiated. |
When-New- Item-Instance | N | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the cursor or input focus moves to another item. |
When-New- Record-Instance | N | FRMBLK | Yes | SELRESUNRES | This trigger fires when the cursor or input focus is moved to a different record. |
When-Radio- Changed | I | FRMBLKITM | Yes | SELRESUNRES | This trigger fires when the selected radio group button is changed. |
When- Remove- Record | B | FRMBLKITM | No | SELUNRES | This trigger fires when the operator deletes a record. |
When-Timer- Expired | I | FRM | Yes | SELRESUNRES | This trigger fires when a timer runs out of time. |
When- Validate- Item | V | FRMBLKITM | No | SELUNRES | This trigger fires when Forms performs the item validation process. |
Page 595
Name | TYP | USG | QRY | RES | Description |
When-Validate- Record | V | FRMBLK | No | SELUNRES | This trigger fires when Forms performs the record validation process. |
When-Window- Activated | I | FRM | Yes | SELRESUNRES | This trigger fires when a window is made the current window. |
When-Window- Closed | I | FRM | Yes | SELRESUNRES | This trigger fires when the window is closed by the operator. |
When-Window- Deactivated | I | FRM | Yes | SELRESUNRES | This trigger fires when the window is deactivated. |
When-Window- Resized | I | FRM | Yes | SELRESUNRES | This trigger fires when the window is resized. |
Page 596