LOB As A Link in Apex

APEX 4.1 enables to include a download link to LOB object in standard or interactive repors.   Documentation is available  here, however the approach is not so obvious from it.  So here is quick recap, how it works:

  1. In report query you must have column that contains LOB length  (not LOB itself!) –  so something like select dbms_lob.getlength(MY_LOB) my_lob_lenght from MY_TABLE
  2. The report column corresponding to LOB length should be set as:
    Display As: Display As Text (escape special characters, does not save state)
    Number/Date Format: DOWNLOAD:TABLE_NAME:LOB_COLUMN_NAME:ROW_PRIMARY_KEY_COLUMN
    (beware names are case sensitive here)
  3. When more sophisticated download behaviour is needed you should also include  columns for MIME type of data, file name and modification timestamp.   Once you store basic DOWNLOAD format you can edit it with masked edit link “BLOB Download Format Mask”
  4. Download link is only shown when LOB length > 0 and is not null.

Screenshot of column definition with DOWNLOAD format masked edit:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">