Home » RDBMS Server » Server Administration » how to insert gif image into table?
how to insert gif image into table? [message #373808] Sat, 12 May 2001 08:41 Go to next message
chandrakumar
Messages: 1
Registered: May 2001
Junior Member
Tell me, how to insert 'blob' type data into a table,
with a example query.

Also, tell me how to retrieve one.
Re: how to insert gif image into table? [message #373815 is a reply to message #373808] Mon, 14 May 2001 09:44 Go to previous message
Bala
Messages: 205
Registered: November 1999
Senior Member
Hi,

This is an example i took it from
http://asktom.oracle.com

create table demo
( id int primary key,
theBlob blob
)
/

create or replace directory my_files as
'C:/oracle/admin/bintest/public_html';

declare
l_blob blob;
l_bfile bfile;
begin
insert into demo values ( 1, empty_blob() )
returning theBlob into l_blob;

l_bfile := bfilename( 'MY_FILES', 'pic1.gif' );
dbms_lob.fileopen( l_bfile );

dbms_lob.loadfromfile( l_blob, l_bfile,
dbms_lob.getlength( l_bfile ) );

dbms_lob.fileclose( l_bfile );
end;
/
commit;

Keep the file the specified directory and run the plsql block......

For retreiving, i don't have specific examples...
if you go to the above site and search for
BLOB you will get some examples...........

Bala.
Previous Topic: DB´s Models...
Next Topic: Re: generating row number
Goto Forum:
  


Current Time: Mon Jul 01 03:59:52 CDT 2024