Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\bldr_pg_comp.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>Understanding Page Computations</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1" /> <meta name="date" content="2009-04-14T16:11:27Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Understanding Page Computations" /> <meta name="relnum" content="Release 3.2" /> <meta name="partnum" content="E11947-01" /> <link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> <link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" /> <link rel="contents" href="toc.htm" title="Contents" type="text/html" /> <link rel="up" href="preface.htm" title="Home" type="text/html" /> <link rel="up" href="bldr_pgs.htm" title="Working with Application Pages" type="text/html" /> <link rel="up" href="bldr_pg_edit.htm" title="Editing a Page Definition" type="text/html" /> <link rel="up" href="bldr_pg_comp.htm" title="Understanding Page Computat..." type="text/html" /> <link rel="prev" href="concept_shared_comp.htm" title="Previous" type="text/html" /> <link rel="next" href="bldr_validate.htm" title="Next" type="text/html" /> </head> <body> <p id="BREADCRUMBING"><a href="preface.htm" title="Home">Home</a> > <a href="bldr_pgs.htm" title="Working with Application Pages">Working with Application Pages</a> > <a href="bldr_pg_edit.htm" title="Editing a Page Definition">Editing a Page Definition</a> > Understanding Page Computat...</p> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr valign="bottom"> <td align="left"></td> <td align="center"><a href="concept_shared_comp.htm"><img src="dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="bldr_validate.htm"><img src="dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="BABDAAFC" name="BABDAAFC"></a></p> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h1><a name="HTMDB04017|page computations"></a>Understanding Page Computations</h1> <p>Use page computations to assign a value to an identified item when a page is submitted or displayed. You can also use application-level computations to assign values to items. Most application-level computations are performed for every page in an application. In contrast, computations created at the page-level only execute when that page is rendered or processed.</p> <div align="center"> <div class="inftblnotealso"><br /> <table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0"> <tbody> <tr> <td align="left"> <p class="notep1">See Also:</p> <a href="bldr_app_comp.htm#BABBEJEF">"Understanding Application Computations"</a></td> </tr> </tbody> </table> <br /></div> <!-- class="inftblnotealso" --></div> <a id="sthref568" name="sthref568"></a> <p class="subhead2">Topics:</p> <ul> <li> <p><a href="#CJGJDJFC">Creating a Page Computation</a></p> </li> <li> <p><a href="#BABEEACI">Understanding Computation Points and Computation Syntax</a></p> </li> <li> <p><a href="#BABJJBIB">Editing Page Computation Attributes</a></p> </li> </ul> <a id="CJGJDJFC" name="CJGJDJFC"></a> <div class="sect3"><!-- infolevel="all" infotype="General" --> <h2><a name="HTMDB25136" id="HTMDB25136"></a>Creating a Page Computation<a id="sthref569" name="sthref569"></a></h2> <p>A page computation assigns a value to an identified item when a page is displayed or submitted (rendered and processed).You create a page computation by running the <a id="sthref570" name="sthref570"></a><a id="sthref571" name="sthref571"></a>Create Page Computation Wizard. For each computation, specify the item for which you are creating the computation and a computation type.</p> <div align="center"> <div class="inftblnotealso"><br /> <table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0"> <tbody> <tr> <td align="left"> <p class="notep1">See Also:</p> <a href="bldr_pg_rndr_ctrl.htm#CHDEJJJJ">"Computations"</a></td> </tr> </tbody> </table> <br /></div> <!-- class="inftblnotealso" --></div> <p>To create a page computation:</p> <ol> <li> <p>Navigate to the appropriate Page Definition. See <a href="bldr_goto_pgdef.htm#CJGHCACC">"Accessing a Page Definition"</a>.</p> </li> <li> <p>Under Computations, click the <span class="bold">Create</span> icon.</p> </li> <li> <p>For Item Location, select where the computation will execute and click <span class="bold">Next</span>. Location options include:</p> <ul> <li> <p>Item on this Page</p> </li> <li> <p>Item on Another Page</p> </li> <li> <p>Application Level Item</p> </li> </ul> </li> <li> <p>For Item, select the item and computation point at which you would like to perform the computation:</p> <ol> <li> <p>Compute Item - Select the item the computation will update.</p> </li> <li> <p>Sequence - Select the order of evaluation.</p> </li> <li> <p>Computation Point - Select the point at which the computation executes. The computation point <span class="bold">On New Instance</span> executes the computation when a new session (or instance) is generated.</p> </li> <li> <p>Computation Type - Select the method of computation you want to create.</p> </li> <li> <p>Click <span class="bold">Next</span>.</p> </li> </ol> </li> <li> <p>In Computation, enter a computation that corresponds to the selected computation type and click <span class="bold">Next</span>.</p> </li> <li> <p>On Condition, you can choose to make the computation conditional. To make a computation conditional, make a selection from the Condition Type list and enter text in the expression fields.</p> </li> <li> <p>Click <span class="bold">Create</span>.</p> </li> </ol> </div> <!-- class="sect3" --> <a id="BABEEACI" name="BABEEACI"></a> <div class="sect3"><!-- infolevel="all" infotype="General" --> <h2><a name="HTMDB25137" id="HTMDB25137"></a>Understanding Computation Points and Computation Syntax<a id="sthref572" name="sthref572"></a><a id="sthref573" name="sthref573"></a></h2> <p>A good example of using computations can be illustrated by a page containing form fields for entering phone numbers. In this example, the phone number is stored in one database column; however, the data entry form breaks the phone number into three components: area code, prefix, and line number. In this example, the page items are called <code>P10_AREA_CODE</code>, <code>P10_PREFIX</code>, and <code>P10_LINE_NUMBER</code>.</p> <p>Next, suppose you need to combine the values stored in these items into a single string. You could accomplish this by using an After Submit computation and store the combined values in an item called <code>P10_PHONE_NUMBER</code>.</p> <p>To create a computation to store the combined values of <code>P10_AREA_CODE</code>, <code>P10_PREFIX</code>, and <code>P10_LINE_NUMBER</code> in new items:</p> <ol> <li> <p>Navigate to the appropriate Page Definition. See <a href="bldr_goto_pgdef.htm#CJGHCACC">"Accessing a Page Definition"</a>.</p> </li> <li> <p>Create a item named <code>P10_PHONE_NUMBER</code> to store the combined values of <code>P10_AREA_CODE</code>, <code>P10_PREFIX</code>, and <code>P10_LINE_NUMBER</code>. See <a href="bldapp_item_diffs.htm#BCEFHBHG">"Differences Between Page Items and Application Items"</a>.</p> </li> <li> <p>Under Computations, click the <span class="bold">Create</span> icon.</p> </li> <li> <p>For Item Location, select <span class="bold">Item on this Page</span> and click <span class="bold">Next</span>.</p> </li> <li> <p>For Computation, select <span class="bold">P10_PHONE_NUMBER.</span></p> </li> <li> <p>For Sequence, select the order of evaluation.</p> </li> <li> <p>For Computation, you have the option of creating one of the following computation types:</p> <ol> <li> <p>Static Assignment:</p> <ul> <li> <p>For Computation Type, select <span class="bold">Static Assignment</span> and click <span class="bold">Next</span>.</p> </li> <li> <p>Enter the following computation:</p> <pre xml:space="preserve" class="oac_no_warn"> (&P10_AREA_CODE.) &P10_PREFIX.-&P10_LINE_NUMBER. </pre></li> <li> <p>Click <span class="bold">Next</span>.</p> </li> </ul> </li> <li> <p>PL/SQL Function Body:</p> <ul> <li> <p>For Computation Type, select <span class="bold">PL/SQL Function Body</span> and click <span class="bold">Next</span>.</p> </li> <li> <p>Enter the following computation:</p> <pre xml:space="preserve" class="oac_no_warn"> DECLARE l_return_value VARCHAR2(300) DEFAULT NULL; BEGIN l_return_value := '('||:P10_AREA_CODE||')'||:P10_PREFIX||'-'||:P10_LINE_NUMBER; RETURN l_return_value; END; </pre></li> <li> <p>Click <span class="bold">Next</span>.</p> </li> </ul> </li> <li> <p>SQL Query:</p> <ul> <li> <p>For Computation Type, select <span class="bold">SQL Query</span> and click <span class="bold">Next</span>.</p> </li> <li> <p>Enter the following computation:</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT '('||:P10_AREA_CODE||')'||:P10_PREFIX||'-'||:P10_LINE_NUMBER FROM DUAL </pre></li> <li> <p>Click <span class="bold">Next</span>.</p> </li> </ul> </li> <li> <p>PLSQL Expression:</p> <ul> <li> <p>For Computation Type, select <span class="bold">PLSQL Expression</span> and click <span class="bold">Next</span>.</p> </li> <li> <p>Enter the following computation:</p> <pre xml:space="preserve" class="oac_no_warn"> '('||:P10_AREA_CODE||')'||:P10_PREFIX||'-'||:P10_LINE_NUMBER </pre></li> <li> <p>Click <span class="bold">Next</span>.</p> </li> </ul> </li> </ol> </li> <li> <p>Click <span class="bold">Create</span>.</p> </li> </ol> </div> <!-- class="sect3" --> <a id="BABJJBIB" name="BABJJBIB"></a> <div class="sect3"><!-- infolevel="all" infotype="General" --> <h2><a name="HTMDB25138" id="HTMDB25138"></a>Editing Page Computation Attributes<a id="sthref574" name="sthref574"></a></h2> <p>Once you create a computation, you can edit it on the Edit Page Computation page.</p> <p>To edit a page computation:</p> <ol> <li> <p>Navigate to the appropriate Page Definition. See <a href="bldr_goto_pgdef.htm#CJGHCACC">"Accessing a Page Definition"</a>.</p> </li> <li> <p>Under Computations, select the computation name.</p> <p>The Edit Page Computation page appears.</p> </li> <li> <p>Edit the appropriate attributes.</p> </li> <li> <p>Click <span class="bold">Apply Changes</span>.</p> </li> </ol> <div class="sect4"><!-- infolevel="all" infotype="General" --><a id="sthref575" name="sthref575"></a> <h3><a name="HTMDB25139" id="HTMDB25139"></a>Editing the Computation Point and Source<a id="sthref576" name="sthref576"></a><a id="sthref577" name="sthref577"></a></h3> <p>You control when a computation executes under the Computation Point attributes by specifying a sequence and a computation point. The computation point <span class="bold">On New Instance</span> executes the computation when a new session (or instance) is generated.</p> <p>Under Source, enter an expression or query to compute an item's value. In the event a computation fails, you can optionally define an error message in the Computation Error Message field.</p> </div> <!-- class="sect4" --> <div class="sect4"><!-- infolevel="all" infotype="General" --><a id="sthref578" name="sthref578"></a> <h3><a name="HTMDB25140" id="HTMDB25140"></a>Creating Conditional Computations<a id="sthref579" name="sthref579"></a></h3> <p>You can make a computation conditional by making a selection from the Condition Type list and entering text in the expression fields.</p> </div> <!-- class="sect4" --></div> <!-- class="sect3" --></div> <!-- class="sect2" --> <!-- Start Footer --> <div class="footer"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr> <td align="left"><span class="copyrightlogo">Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.</span><br /> <a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td> <td align="center"><a href="concept_shared_comp.htm"><img src="dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="bldr_validate.htm"><img src="dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> </div> <!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de