1 person found this helpful
dbms_output.put_line will not work with Apex. Instead you have to use htp.print(s); This will of course only work for text files, not for binary content like images.
Thank for you reply.
I am mainly storing image file.
How can i achieve it for image file.
you can find a suggestion in How to get Img src path as from database table (answer by Pavel_p).
Alternatively you could create a page item of type "Display Image" and set the attribute "Based On" to "BLOB column returned by SQL statement".
As SQL statement provide "select get_image('IMAGES','xxx.gif') from dual;" (of course replacing xxx.gif with your image name).
The function GET_IMAGE would by something like:
create or replace function get_image(dir_name in varchar2, file_name in varchar2) return blob is
l_bfile := bfilename(dir_name, file_name);
if dbms_lob.fileexists(l_bfile) = 1
dbms_lob.loadfromfile(l_blob, l_bfile, dbms_lob.getlength(l_bfile));
Thanks a lot.
It saved my time.