Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Displaying the BLOB files(PDF,TXT,IMAGE,etc) in the Form as an Attachment

895624May 16 2013 — edited May 16 2013
Hi all,

I need to Open a file which is stored in the Data base Table & the Data type is of BLOB so i am populating the data but i need to display the attachment which is stored in the BLOB file when the button is clicked & i am using Oracle 10g

I have been just placed a Button & written the below code in WHEN_BUTTON_PRESSED Trigger & i have tried it out by placing a image icon & WHEN_IMAGE_PRESSED but it's not getting worked

It is Directly Coming in to Exception..


DECLARE

vblob BLOB;
vmime VARCHAR2(30);

BEGIN
select attachment,MIME_TYPE into vblob,vmime
from Table_name_a
where UNIQUE_ID = 16842;--:ITEM_RESULT.DRAWINGNO;

htp.init;
owa_util.mime_header( vmime, false);
-- owa_util.mime_header( 'image/jpeg', false);
-- owa_util.mime_header( 'image/jfif', false);
-- owa_util.mime_header( 'image/gif', false);
-- owa_util.mime_header( 'application/word' , FALSE);-- to read MS WORD doc
owa_util.mime_header( 'application/pdf' , FALSE);-- to read ADObE

message ('attachment type is' ||vmime);
message ('attachment type is' ||vmime);
owa_util.http_header_close;
wpg_docload.download_file(vblob);

exception
when no_data_found then
dbms_output.put_line('1. attachment type is' ||vmime);
-- NULL;
end;


so if any body has any idea Please let me Know

Hope for the Reply.

Thanks & Regards
K Nikethan Reddy
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 13 2013
Added on May 16 2013
7 comments
1,466 views