Thanks Pratap! How do i call the Images stored in the Database using a procedure? [message #19114] |
Thu, 28 February 2002 11:15 |
Kalpa
Messages: 21 Registered: February 2002
|
Junior Member |
|
|
I have a table that stores images..
Now i want to write a procedure that retrieves these images from the database.
HOW DO I DO IT??
create table tbl_images( filename varchar2(255)
primary key, image BLOB);
/
create or replace directory MY_IMAGES as '/usr/users/tauri_e/DBImages';
/
create or replace procedure insert_image as
f_lob bfile;
b_lob blob;
begin
insert into tbl_images
(filename,image)
values ('Home', empty_blob() )
return image into b_lob;
f_lob := bfilename( 'MY_IMAGES', 'home.gif' );
dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
dbms_lob.fileclose(f_lob);
commit;
end;
/
|
|
|
|
Re: Thanks Pratap! How do i call the Images stored in the Database using a procedure? [message #19127 is a reply to message #19122] |
Fri, 01 March 2002 05:10 |
Kalpa
Messages: 21 Registered: February 2002
|
Junior Member |
|
|
I am creating a website using PL/SQL SERVER PAGES. i.e. .psp and Oracle 9iAS as my application server.
So basically i want to retrieve the the images to a web page. But psp pages supports all PL/SQL objects.
And how .psp works is,
you write a stored procedure that creates html pages and also retrieves data/images from the database. This way retrieving the data from the database to a web page is much faster because the stored procedures are precompiled.
Thanks!
|
|
|