HomeOracle Adding Processes to HTML DB Applications
Adding Processes to HTML DB Applications
In this second part of a three-part series covering HTML DB applications, you will learn about processes. This article is excerpted from chapter 13 of the Oracle HTML DB Handbook, written by Lawrence Linnemeyer and Bradley Brown (McGraw-Hill, 2006; ISBN: 0072257687).
Processes are the heart of an HTML DB application when it comes to making the application more than just another HTML application. The primary purpose of processes is to interact with the database, but other types of processes are also available to the developer. Most of the time processes are defined at the page level, but you can also define application-level processes. Processes defined at the application level will be evaluated for every page of the application unless limited by their Condition section.
Like computations, processes can be defined to be evaluated either during the page rendering or during the page processing. Those done during page rendering are usually used to retrieve data from the database and populate items on the page. Those done during processing are often used to save the user-entered information into the database. If we look back at a form page we created using wizards, such as the one to edit CONTACTS, we see three processes—one to fetch a row from CONTACTS, one to process a row of CONTACTS, and one to reset the page. The first two are Data Manipulation type processes, whereas the last is a Session State type process.
Processes can both reference and set the values of any page-level or application-level item for the current application. The items will be referenced in different ways, depending on the type of processes you are defining. You will use one of the substitution variable syntaxes discussed in Chapter 6, but most often you will use the bind variable syntax (:P8_MY_ITEM), or in PL/SQL you might use the v() or nv() function.