Home » SQL & PL/SQL » SQL & PL/SQL » Thanks Pratap! How do i call the Images stored in the Database using a procedure?
Thanks Pratap! How do i call the Images stored in the Database using a procedure? [message #19114] Thu, 28 February 2002 11:15 Go to next message
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 #19122 is a reply to message #19114] Fri, 01 March 2002 00:13 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
where u want to retrieve the image to ? r u using developer 2000. where u want to show the image ?

can u explain little bit more
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 Go to previous message
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!
Previous Topic: PL/SQL "Success" Messages
Next Topic: Dynamic From Statement in PL/SQL
Goto Forum:
  


Current Time: Thu Apr 18 08:58:52 CDT 2024