Databases Reference
In-Depth Information
4.
Edit the
Ticket Details
region again by double-clicking its name. You see the source of the
query.
Locate and open the file
ch6_report.txt
, which you can find where you extracted the
class files earlier, and copy the contents into the
Region Source
, replacing all text that is
currently there. See Figure
6-76
.
5.
Figure 6-76.
Entering the report query with a BLOB column
Notice the change in the last column in the SQL statement. Using
dbms_lob.getlength
indicates to APEX
whether the
ATTACHMENT
BLOB column contains any data. If it does, the query returns a number greater than 0.
Now you need to alter the report column to display a link allowing the end user to download any document that
may have been uploaded:
6.
Click the
Report Attributes
tab. Doing so saves all changes you just made on the Region
Definition tab.
Edit the
ATTACHMENT
column, and scroll to the
Column Attributes
section.
7.
In order for the report column to recognize the fact that it's supposed to be displayed as a BLOB, you must
indicate that the format for the field is a BLOB by entering the word
BLOB
in the Number/Date Format field:
In the
Column Attributes
section, enter the word
BLOB
into the
Number/Date Format
field, and press
Ta b
. The page refreshes, and the
Blob Column Attributes
section is now
visible on the page.
8.
In the
Blob Column Attributes
section, enter
TICKET_DETAILS
for
Blob Table
,
ATTACHMENT
for
Blob Column
,
TICKET_DETAILS_ID
for
Primary Key Column 1
,
MIME_TYPE
for
Mimetype Column
,
FILE_NAME
for
Filename Column
, and
Download
for
Download Text
,
as shown in Figure
6-77
.
9.