Home » Developer & Programmer » Forms » How to store image in BLOB and display in oracle forms
How to store image in BLOB and display in oracle forms [message #291194] Thu, 03 January 2008 06:09 Go to next message
hari_bk
Messages: 110
Registered: March 2006
Senior Member
Hi Can any one help me with following 2 steps

1) To store an Image in BLOB datatype of a Table
2) To display the stored Image in Oracle Forms (6i)

Thanks a Ton in advance.

HK
Re: How to store image in BLOB and display in oracle forms [message #291420 is a reply to message #291194] Fri, 04 January 2008 02:46 Go to previous messageGo to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
grant create any directory to a;
grant create any library to a;
create or replace directory photo_dir as 'e:photo';
create table photos (blob_column blob);

declare
a_blob blob;
a_bfile bfile := bfilename('PHOTO_DIR','flower.jpg');
begin
insert into photos values (empty_blob()) returning blob_column into a_blob;
dbms_lob.fileopen(a_bfile);
dbms_lob.loadfromfile(a_blob,a_bfile,dbms_lob.getlength(a_bfile));
dbms_lob.fileclose(a_bfile);
commit;
end;
/

user reports to display the image. Change the file format of the displayed columns in the reports to image.

- Das
Re: How to store image in BLOB and display in oracle forms [message #291421 is a reply to message #291194] Fri, 04 January 2008 02:53 Go to previous messageGo to next message
mintomohan
Messages: 104
Registered: November 2006
Location: India
Senior Member
hi,

you can use the following method also:

First create a table:
id - number
img - blob

in the fmb, you can create a data block from the table.
make the item for img as "Image Item".

Then you can display the image by simply giving an execute_query on the data block.

Minto
Re: How to store image in BLOB and display in oracle forms [message #291422 is a reply to message #291194] Fri, 04 January 2008 02:56 Go to previous message
mintomohan
Messages: 104
Registered: November 2006
Location: India
Senior Member
to read an image from a file to a form, you can use the forms built-in READ_IMAGE_FILE

PROCEDURE READ_IMAGE_FILE (file_name VARCHAR2, file_type VARCHAR2, item_name VARCHAR2); 


Minto
Previous Topic: Oracle Forms 4.5 on windows vista
Next Topic: getting message when execute query
Goto Forum:
  


Current Time: Thu Mar 28 05:12:21 CDT 2024