`
xitong
  • 浏览: 6189888 次
文章分类
社区版块
存档分类
最新评论

Triggers in Oracle Forms

 
阅读更多

Triggers in Oracle Forms

Triggers are blocks of PL/SQL code that are written to perform tasks when a specific event occurs within an application. In effect, an Oracle Forms trigger is an event-handler written in PL/SQL to augment (or occasionally replace) the default processing behavior. Every trigger has a name, and contains one or more PL/SQL statements. A trigger encapsulates PL/SQL code so that it can be associated with an event and executed and maintained as a distinct object.

Block Processing Triggers:

Block processing triggers fire in response to events related to record management in a block.

  • When-Create-Record Perform an action whenever Oracle Forms attempts to create a new record in a block.
  • When-Clear-Block Perform an action whenever Oracle Forms flushes the current block; that is, removes all records from the block.
  • When-Database-Record Perform an action whenever Oracle Forms changes a record’s status to Insert or Update, thus indicating that the record should be processed by the next COMMIT_FORM operation.

Interface Event Triggers:

Interface event triggers fire in response to events that occur in the form interface. Some of these triggers, such as When-Button-Pressed, fire only in response to operator input or manipulation. Others, like When-Window-Activated, can fire in response to both operator input and programmatic control.

  • When-Button-Pressed Initiate an action when an operator selects a button, either with the mouse or through keyboard selection.
  • When-Checkbox-Changed Initiate an action when the operator toggles the state of a check box, either with the mouse or through keyboard selection.
  • When-Image-Activated Initiate an action whenever the operator double-clicks an image item.
  • When-Image-Pressed Initiate an action whenever an operator clicks on an image item.
  • When-Radio-Changed Initiate an action when an operator changes the current radio button selected in a radio group item.
  • When-Window-Activated Initiate an action whenever an operator or the application activates a window.
  • When-Window-Closed Initiate an action whenever an operator closes a window with the window manager’s Close command.
  • When-Window-Deactivated Initiate an action whenever a window is deactivated as a result of another window becoming the active window.

Master/Detail Triggers:

Oracle Forms generates master/detail triggers automatically when a master/detail relation is defined between blocks. The default master/detail triggers enforce coordination between records in a detail block and the master record in a master block. Unless developing custom block-coordination schemes, you do not need to define these triggers.

  • On-Check-Delete-Master Fires when Oracle Forms attempts to delete a record in a block that is a master block in a master/detail relation.
  • On-Clear-Details Fires when Oracle Forms needs to clear records in a block that is a detail block in a master/detail relation because those records no longer correspond to the current record in the master block.
  • On-Populate-Details Fires when Oracle Forms needs to fetch records into a block that is the detail block in a master/detail relation so that detail records are synchronized with the current record in the master block.

Message-Handling Triggers:

Oracle Forms automatically issues appropriate error and informational messages in response to runtime events. Message handling triggers fire in response to these default messaging events.

  • On-Error Replace a default error message with a custom error message, or to trap and recover from an error.
  • On-Message To trap and respond to a message; for example, to replace a default message issued by Oracle Forms with a custom message.

Validation Triggers:

Validation triggers fire when Oracle Forms validates data in an item or record. Oracle Forms performs validation checks during navigation that occurs in response to operator input, programmatic control, or default processing, such as a Commit operation.

  • When-Validate-Item
  • When-Validate-Record

Navigational Triggers:

Navigational triggers fire in response to navigational events. Navigational triggers can be further sub-divided into two categories: Pre-and Post-triggers, and When-New-Instance triggers. Pre-and Post- Triggers fire as Oracle Forms navigates internally through different levels of the object hierarchy. When-New-Instance-Triggers fire at the end of a navigational sequence that places the input focus on a different item.

  • Pre-FormPerform an action just before Oracle Forms navigates to the form from “outside” the form, such as at form startup.
  • Pre-Block Perform an action before Oracle Forms navigates to the block level from the form level.
  • Pre-Record Perform an action before Oracle Forms navigates to the record level from the block level.
  • Pre-Text-Item Perform an action before Oracle Forms navigates to a text item from the record level.
  • Post-Text-Item Manipulate an item when Oracle Forms leaves a text item and navigates to the record level.
  • Post-Record Manipulate a record when Oracle Forms leaves a record and navigates to the block level.
  • Post-Block Manipulate the current record when Oracle Forms leaves a block and navigates to the form level.
  • Post-Form Perform an action before Oracle Forms navigates to “outside” the form, such as when exiting the form.
  • When-New-Form-InstancePerform an action at form start-up. (Occurs after the Pre-Form trigger fires).
  • When-New-Block-Instance Perform an action immediately after the input focus moves to an item in a block other than the block that previously had input focus.
  • When-New-Record-Instance Perform an action immediately after the input focus moves to an item in a different record.
  • When-New-Item-Instance Perform an action immediately after the input focus moves to a different item.

Transactional Triggers:

Transactional triggers fire in response to a wide variety of events that occur as a form interacts with the data source.

  • On-Delete
  • On-Insert
  • On-Update
  • On-Logon
  • On-Logout
  • Post-Database-Commit
  • Post-Delete
  • Post-Insert
  • Post-Update
  • Pre-Commit
  • Pre-Delete
  • Pre-Insert
  • Pre-Update

Query-Time Triggers:

Query-time triggers fire just before and just after the operator or the application executes a query in a block.

  • Pre-QueryValidate the current query criteria or provide additional query criteria programmatically, just before sending the SELECT statement to the database.
  • Post-Query Perform an action after fetching a record, such as looking up values in other tables based on a value in the current record. Fires once for each record fetched into the block.


source:http://imdjkoch.wordpress.com/2010/09/15/triggers-in-oracle-forms/

分享到:
评论

相关推荐

    Programming Oracle Triggers And Stored Procedures 3rd ed

    Programming Oracle Triggers And Stored Procedures 英文第三版 自制CHM格式,可DropDownList选章选节阅读,可调节字体大小,大大方便了Viliv S5等手持上网设备的阅读。 注意: 由于内部使用了MS XML Parser,本...

    Oracle Security

    Security in an oracle System Chapter 1 Oracle and Security What’s It All About? The Oracle Security Model Procedures, Policies, and Plans If I Had a Hammer... Chapter 2 Oracle System Files ...

    (prentice hall 2003) - programming oracle triggers and stored procedures, 3rd ed.rar

    (prentice hall 2003) - programming oracle triggers and stored procedures, 3rd ed.rar

    Oracle PL/SQL programming(5th Edition)

    Topics covered: How to use Oracle PL/SQL in all its manifestations through Oracle9i. Fundamentals of program structure (loops, cases, exceptions, etc.) and execution get attention, as do data types, ...

    Oracle 数据库攻防 英文原版

    Chapter 6 - Triggers Chapter 7 - Indirect Privilege Escalation Chapter 8 - Defeating Virtual Private Databases Chapter 9 - Attacking Oracle PL/SQL Web Applications Chapter 10 - Running ...

    oracle-pl-sql-programming-5th-edition

    Thoroughly updated for Oracle Database 11g Release 2, this edition reveals new PL/SQL features and provides extensive code samples, ranging from simple examples to complex and complete applications, ...

    Oracle Database 12c PL-SQL programming

    Code testing, security, and object-oriented programming techniques are fully covered in this comprehensive Oracle Press guide. Explore new SQL and PL/SQL features in Oracle Database 12c Build ...

    vagrant plugin install vagrant-triggers

    The Vagrantfile requires the plugin vagrant-triggers. To install the plugin run: $ vagrant plugin install vagrant-triggers 安装Docker的管理程序 Deis 在 vagrant,需要安装vagrant-triggers,由于网络...

    Professional SQL Server 2005 CLR Programming with Stored Procedures, Functions, Triggers, Aggregates, and Types

    In English. SQL CLR is an enhancement to T-SQL programming for SQL Server, is one new feature for SQL Server 2005 which let you embed C#, VB.Net code into T-SQL objects like stored procedures, ...

    Oracle Concepts中英文对照版(10g R2).chm

    Triggers 第 22 章,触发器 Chapter 23, Information Integration 第 23 章,信息整合 Part IV Oracle Database Application Development 第四部分 Oracle 数据库应用程序开发 Chapter 24, SQL, PL/SQL,...

    Oracle 10g Concepts 中文版

    Chapter 22, Triggers 第 22 章,触发器 Chapter 23, Information Integration 第 23 章,信息整合 Part IV Oracle Database Application Development 第四部分 Oracle 数据库应用程序开发 Chapter 24, SQL, PL/...

    Oracle 10g r2 Concepts 手册(中英文对照阅读版本).chm

    Chapter 22, Triggers 第 22 章,触发器 Chapter 23, Information Integration 第 23 章,信息整合 Part IV Oracle Database Application Development 第四部分 Oracle 数据库应用程序开发 Chapter 24, SQL, PL/...

    最完整的Toad For Oracle使用手册

    Triggers 1002 Types 1004 Users 1010 Views 1012 Troubleshooting 1017 Unicode Troubleshooting 1017 Hints and Tips: Connecting To Personal Oracle 1018 Hints and Tips: Table Does Not Exist Errors 1019 ...

    Oracle PL/SQL Programming, 5th Edition

    Thoroughly updated for Oracle Database 11g Release 2, this edition reveals new PL/SQL features and provides extensive code samples, ranging from simple examples to complex and complete applications, ...

    Oracle PL/SQL programming

    Considered the best Oracle PL/SQL programming guide by the Oracle community, this definitive ... Build modular, easy-to-maintain PL/SQL applications using packages, procedures, functions, and triggers

    oracle各种文档

    数据仓库建模技术.pdf 在数据库中实现base64编码和....chm v2.0.pdfPrentice.Programming.Oracle.Triggers.And.Stored.Procedures.3rd.Edition.eBook-LiB.chm ORACLE中如何利用Rowid查找和刪除表中的重复记录.doc

    oracle concepts概念手册中英文版(10gR2)

    Chapter 22, Triggers 第 22 章,触发器 Chapter 23, Information Integration 第 23 章,信息整合 Part IV Oracle Database Application Development 第四部分 Oracle 数据库应用程序开发 Chapter 24, SQL, PL/...

    触发器Triggers、MultiTrggers、EventTrigger应用案例

    触发器Triggers、MultiTrggers、EventTrigger应用案例

    Oracle Concepts 中文英文对照版 (10g R2)

    Triggers 第 22 章,触发器 Chapter 23, Information Integration 第 23 章,信息整合 Part IV Oracle Database Application Development 第四部分 Oracle 数据库应用程序开发 Chapter 24, SQL, PL/SQL,...

Global site tag (gtag.js) - Google Analytics