Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\AEAPI\apex_util033.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>GET_BLOB_FILE_SRC 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="GET_BLOB_FILE_SRC 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_util033.htm" title="GET_BLOB_FILE..." type="text/html" /> <link rel="prev" href="apex_util032.htm" title="Previous" type="text/html" /> <link rel="next" href="apex_util034.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> > GET_BLOB_FILE...</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_util032.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="apex_util034.htm"><img src="../dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="CHDICGDA" name="CHDICGDA"></a></p> <hr /> <div class="refsect1"> <h1><a name="AEAPI129" id="AEAPI129"></a>GET_BLOB_FILE_SRC <a id="sthref183" name="sthref183"></a>Function</h1> <p>As an alternative to using the built-in methods of providing a download link, you can use the <code>APEX_UTIL.GET_BLOB_FILE_SRC</code> function. One advantage of this approach, is the ability to more specifically format the display of the image (with height and width tags). Please note that this approach is only valid if called from a valid Oracle Application Express session. Also, this method requires that the parameters that describe the BLOB to be listed as the format of a valid item within the application. That item is then referenced by the function.</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="../advnc_blob_reports.htm">"About BLOB Support in Forms and Reports"</a> in <a href="../preface.htm"><span class="italic">Oracle Application Express Application Builder User's Guide</span></a></td> </tr> </tbody> </table> <br /></div> <!-- class="inftblnotealso" --></div> <a id="sthref184" name="sthref184"></a> <p class="subhead2">Syntax</p> <pre xml:space="preserve" class="oac_no_warn"> APEX_UTIL.GET_BLOB_FILE_SRC ( p_item_name IN VARCHAR2 DEFAULT NULL, p_v1 IN VARCHAR2 DEFAULT NULL, p_v2 IN VARCHAR2 DEFAULT NULL, p_content_disposition IN VARCHAR2 DEFAULT NULL) RETURN VARCHAR2; </pre> <a id="sthref185" name="sthref185"></a> <p class="subhead2">Parameters</p> <p><a href="#CHDIHEEJ">Table: GET_BLOB_FILE_SRC Parameters</a> describes the parameters available in <code>GET_BLOB_FILE_SRC</code> function.</p> <div class="tblformal"><a id="sthref186" name="sthref186"></a><a id="CHDIHEEJ" name="CHDIHEEJ"></a> <p class="titleintable">GET_BLOB_FILE_SRC Parameters</p> <table class="Formal" title="GET_BLOB_FILE_SRC Parameters" summary="This table describes the parameters available in the GET_BLOB_FILE_SRC function." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"> <col width="33%" /> <col width="*" /> <thead> <tr align="left" valign="top"> <th align="left" valign="bottom" id="r1c1-t51">Parameter</th> <th align="left" valign="bottom" id="r1c2-t51">Description</th> </tr> </thead> <tbody> <tr align="left" valign="top"> <td align="left" id="r2c1-t51" headers="r1c1-t51"> <p><code>p_item_name</code></p> </td> <td align="left" headers="r2c1-t51 r1c2-t51"> <p>Name of valid application page ITEM that with type FILE that contains the source type of DB column.</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r3c1-t51" headers="r1c1-t51"> <p><code>p_v1</code></p> </td> <td align="left" headers="r3c1-t51 r1c2-t51"> <p>Value of primary key column 1.</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r4c1-t51" headers="r1c1-t51"> <p><code>p_v2</code></p> </td> <td align="left" headers="r4c1-t51 r1c2-t51"> <p>Value of primary key column 2.</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r5c1-t51" headers="r1c1-t51"> <p><code>p_content_disposition</code></p> </td> <td align="left" headers="r5c1-t51 r1c2-t51"> <p>Specify <code>inline</code> or <code>attachment</code>, all other values ignored</p> </td> </tr> </tbody> </table> <br /></div> <!-- class="tblformal" --> <a id="sthref187" name="sthref187"></a> <p class="subhead2">Example</p> <p>As a PLSQL Function Body:</p> <pre xml:space="preserve" class="oac_no_warn"> RETURN '<img src="'||APEX_UTIL.GET_BLOB_FILE_SRC('P2_ATTACHMENT',:P2_EMPNO)||'" />'; </pre> <p>As a Region Source of type SQL:</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT ID, NAME,CASE WHEN NVL(dbms_lob.getlength(document),0) = 0 THEN NULL ELSE CASE WHEN attach_mimetype like 'image%' THEN '<img src="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'" />' ELSE '<a href="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'">Download</a>' end END new_img FROM TEST_WITH_BLOB </pre> <p>The previous example illustrates how to display the <code>BLOB</code> within the report, if it can be displayed, and provide a download link, if it cannot be displayed.</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="../demo.htm">"Running a Demonstration Application"</a> in <a href="../preface.htm"><span class="italic">Oracle Application Express Application Builder User's Guide</span></a>.</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_util032.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="apex_util034.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