Home » RDBMS Server » Server Administration » Regarding Storage Of Images Into Database
Regarding Storage Of Images Into Database [message #372094] Wed, 10 January 2001 01:37 Go to next message
Srinivasulu P
Messages: 5
Registered: December 2000
Junior Member
Hai,This is Srinivasulu P from Lanco Global , Please Help Me Out

Please give me the information related to

1) How to insert image file into my oracle database

2) If U have any source code related to please send me a mail , my mail id is 'sriponnada@rediffmail.com'

Regards
Srinivasulu P
Re: Regarding Storage Of Images Into Database [message #372110 is a reply to message #372094] Wed, 10 January 2001 09:47 Go to previous message
Deanna
Messages: 9
Registered: December 2000
Junior Member
Hi Srinivasulu

I havebeen trying to figure this one out too.

The following links may have info that is helpful
http://www.oracle.com/oramag/oracle/98-Jan/fast.html
http://www.oracle.com/oramag/webcolumns/ta010199_2.html

From what I can tell the code for inserting an image is:
set echo on
set serveroutput on
DECLARE
Image bfile;
BEGIN
DBMS_OUTPUT.PUT_LINE('Starting..');

insert into emp(empno,ename,sal,comm,hiredate,deptno,photo)
values(8002,'Kajol',1500,200,sysdate,10,bfilename('IMGDEMODIR','kajol.jpg'));
commit;
DBMS_OUTPUT.PUT_LINE('bfile inserted..');

select photo into Image
from emp
where empno=8002;

DBMS_OUTPUT.PUT_LINE('Size of the file inserted is ' || DBMS_LOB.GETLENGTH(Image));
END;
/

This was taken from one of the oracle links above.

Let me know if this worked or if you had to tweek the code.

Dee
Previous Topic: Re: finding nth max of column in a table
Next Topic: How to make oracle database case-insensitive?
Goto Forum:
  


Current Time: Sat May 18 01:57:04 CDT 2024