Today I will describe to Display Image Item in Oracle APEX.
What is Display Image Item in Oracle APEX?
- Image URL stored in Page Item Value
- Blob Column specified in the item source
- Blob Column returned by SQL statement
How to Display Image Using Display Image Item in Oracle APEX?
Whenever you want to display an image using a URL then you have to choose this setting in the display image item. Let's take a simple example for better understanding.
SELECT 'https://www.oracle.com/a/ocom/img/dc/em/oracle-apex.png' FROM dualYou can also match with the following screen.
Whenever you choose display image item setting BLOB column specified in the item source it means that the display image page item source is a database column and the column type will be a BLOB otherwise it returns an error. BLOB column specified in the item source option will display the database table image using the automatic row fetch processing process.
Step 1:- Create a Before Header Process for fetch image from a particular table using Automatic Row Fetch. You have to also create the table's primary key page items. You can match the following screen.
Step 2:- Now scroll down your page item property, Go to page item source area and select (DATABASE COLUMN TYPE), and pass table BLOB column type. You can match the following screen.
As you understand with the statement that you have written a SQL query which is return the BLOB column.
Step 1:-Whenever you choose the display item setting(Blob column returned by the SQL statement) option. Then a SQL statement tap opens where you have to write a SQL query that returns the BLOB column.
SELECT IMAGE FROM EMP WHERE MIMETYPE='image/jpeg' AND EMPNO=8222
1 Comments
Hi Javainhand,
ReplyDeletemany thank for your tutorial.
How to use dynamic version (no hard value)
on sql query
SELECT IMAGE FROM EMP
WHERE MIMETYPE='image/jpeg'
AND EMPNO=:P35_KEYVALUE -- instead of 8222
Thanks in advance
Constantino
If you have any doubts, Please let me know