Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\AEAPI\apex_util060.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>PREPARE_URL Function</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1" /> <meta name="date" content="2009-04-14T17:32:16Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="PREPARE_URL Function" /> <meta name="relnum" content="Release 3.2" /> <meta name="partnum" content="E12510-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" title="Home" type="text/html" /> <link rel="up" href="apex_util.htm" title="APEX_UTIL" type="text/html" /> <link rel="up" href="apex_util060.htm" title="PREPARE_URL Function" type="text/html" /> <link rel="prev" href="apex_util059.htm" title="Previous" type="text/html" /> <link rel="next" href="apex_util061.htm" title="Next" type="text/html" /> </head> <body> <p id="BREADCRUMBING"><a href="preface" title="Home">Home</a> > <a href="apex_util.htm" title="APEX_UTIL">APEX_UTIL</a> > PREPARE_URL Function</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="apex_util059.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="apex_util061.htm"><img src="../dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="CDEIBCJD" name="CDEIBCJD"></a></p> <hr /> <div class="refsect1"> <h1><a name="AEAPI160" id="AEAPI160"></a>PREPARE_URL <a id="sthref314" name="sthref314"></a>Function</h1> <p>The PREPARE_URL function serves two purposes:</p> <ol> <li> <p>To return an f?p URL with the Session State Protection checksum argument (&cs=) if one is required.</p> </li> <li> <p>To return an f?p URL with the session ID component replaced with zero (0) if the zero session ID feature is in use and other criteria are met.</p> </li> </ol> <div align="center"> <div class="inftblnote"><br /> <table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0"> <tbody> <tr> <td align="left"> <p class="notep1">Note:</p> The <code>PREPARE_URL</code> functions returns the f?p URL with <code>&cs=<large hex value></code> appended. If you use this returned value, for example in JavaScript, it may be necessary to escape the ampersand in the URL in order to conform with syntax rules of the particular context. One place you may encounter this is in SVG chart SQL queries which might include <code>PREPARE_URL</code> calls.</td> </tr> </tbody> </table> <br /></div> <!-- class="inftblnote" --></div> <a id="sthref315" name="sthref315"></a> <p class="subhead2">Syntax</p> <pre xml:space="preserve" class="oac_no_warn"> APEX_UTIL.PREPARE_URL ( p_url IN VARCHAR2, p_url_charset IN VARCHAR2 default null, p_checksum_type IN VARCHAR2 default null) RETURN VARCHAR2; </pre> <a id="sthref316" name="sthref316"></a> <p class="subhead2">Parameters</p> <p><a href="#CDEJBFIF">Table: PREPARE_URL Parameters</a> describes the parameters available in the PREPARE_URL function.</p> <div class="tblformal"><a id="sthref317" name="sthref317"></a><a id="CDEJBFIF" name="CDEJBFIF"></a> <p class="titleintable">PREPARE_URL Parameters</p> <table class="Formal" title="PREPARE_URL Parameters" summary="This table describes the parameters available in the PREPARE_URL function." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"> <col width="31%" /> <col width="*" /> <thead> <tr align="left" valign="top"> <th align="left" valign="bottom" id="r1c1-t89">Parameter</th> <th align="left" valign="bottom" id="r1c2-t89">Description</th> </tr> </thead> <tbody> <tr align="left" valign="top"> <td align="left" id="r2c1-t89" headers="r1c1-t89"> <p>p_url</p> </td> <td align="left" headers="r2c1-t89 r1c2-t89"> <p>An f?p relative URL with all substitutions resolved</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r3c1-t89" headers="r1c1-t89"> <p>p_url_charset</p> </td> <td align="left" headers="r3c1-t89 r1c2-t89"> <p>The character set name (for example, <code>UTF-8</code>) to use when escaping special characters contained within argument values</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r4c1-t89" headers="r1c1-t89"> <p>p_checksum type</p> </td> <td align="left" headers="r4c1-t89 r1c2-t89"> <p>Null or any of the following six values, <code>SESSION</code> or <code>3</code>, <code>PRIVATE_BOOKMARK</code> or <code>2</code>, or <code>PUBLIC_BOOKMARK</code> or <code>1</code></p> </td> </tr> </tbody> </table> <br /></div> <!-- class="tblformal" --> <a id="sthref318" name="sthref318"></a> <p class="subhead2">Example 1</p> <p>The following example shows how to use the <code>PREPARE_URL</code> function to return a URL with a valid 'SESSION' level checksum argument. This URL sets the value of <code>P1_ITEM</code> page item to <code>xyz</code>.</p> <pre xml:space="preserve" class="oac_no_warn"> DECLARE l_url varchar2(2000); l_app number := v('APP_ID'); l_session number := v('APP_SESSION'); BEGIN l_url := APEX_UTIL.PREPARE_URL( p_url => 'f?p=' || l_app || ':1:'||l_session||'::NO::P1_ITEM:xyz', p_checksum_type => 'SESSION'); END; </pre> <a id="sthref319" name="sthref319"></a> <p class="subhead2">Example 2</p> <p>The following example shows how to use the <code>PREPARE_URL</code> function to return a URL with a zero session ID. In a PL/SQL Dynamic Content region that generates <code>f?p</code> URLs (anchors), call <code>PREPARE_URL</code> to ensure that the session ID will set to zero when the zero session ID feature is in use, when the user is a public user (not authenticated), and when the target page is a public page in the current application:</p> <pre xml:space="preserve" class="oac_no_warn"> htp.p(APEX_UTIL.PREPARE_URL(p_url => 'f?p=' || :APP_ID || ':10:'|| :APP_SESSION ||'::NO::P10_ITEM:ABC'); </pre> <p>When using <code>PREPARE_URL</code> for this purpose, the <code>p_url_charset</code> and <code>p_checksum_type</code> arguments can be omitted. However, it is permissible to use them when both the Session State Protection and Zero Session ID features are applicable.</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="../concept_url_zero.htm">"Facilitating Bookmarks by Using Zero as the Session ID"</a> and <a href="../sec_session_state.htm">"Understanding Session State Protection"</a> in <span class="italic"><a href="http://www.oracle.com/pls/db112/lookup?id=HTMAD">Oracle Application Express Advanced Tutorials</a></span></td> </tr> </tbody> </table> <br /></div> <!-- class="inftblnotealso" --></div> </div> <!-- class="refsect1" --> <!-- 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="apex_util059.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="apex_util061.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