image uploading using bfile data type [message #408607] |
Wed, 17 June 2009 01:19 |
myclassic
Messages: 136 Registered: December 2006 Location: Pakistan
|
Senior Member |
|
|
Dear all
purpose : I want to upload image of all my employees in my db. but DB becomes slow. So i want to upload only path/locator etc. and want to store images in a folder on some drive of my hard disk. and i want to let my application read image at run time.
what i did:::::
Created a table having a column of BFile datatype.
Create table xyz as select * from scott.emp;
alter table xyz
add pic bfile;
desc xyz
Name Null? Type
------------------------------- -------- ----
EMPNO NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
PIC BINARY FILE LOB
Created a directory.
create directory pics as 'E:\Pics';
create directory pics as '\\E\Pics';---tried both options
created a folder at same location. placed a jpg in it.
inserted values in table
insert into xyz values(1234, 'Asad','CLERK',7902,
sysdate, 800, null, 20,bfilename('PICS','1234.jpg'));
commit;
but it is not displayed on form.
what is error and how can it be handled.
regards.
|
|
|
|