If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Problem in inserting pictures into table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-22-09, 11:32
pgudur pgudur is offline
Registered User
 
Join Date: Jul 2009
Posts: 9
Problem in inserting pictures into table


Hi,
I am inserting pictures into table

when execute the procedure it says successfully procedure completed
but i am unable to see pictures in table as +ve number in respective column.

could any one tell me where i am going wrong here
please........

create or replace procedure insert_image
(p_catalogn number,p_photo varchar2)
as
f_photo bfile;
b_photo blob;
begin
update sh_photo set picture=empty_blob()
where catalogn=p_catalogn
return picture into b_photo;
f_photo := bfilename('photos',p_photo);
dbms_lob.fileopen(f_photo,dbms_lob.file_readonly);
dbms_lob.loadfromfile(b_photo,f_photo,dbms_lob.get length(f_photo));
dbms_lob.fileclose(f_photo);
commit;
exception
when others then
dbms_output.put_line('**** error ***** check your procedure');
end;

*************************************

execute insert_image(1,'Animallandscape.jpeg');

begin
insert_image(1,'Animallandscape.jpeg');
end;
PL/SQL procedure successfully completed

*************************************
select catalogn,dbms_lob.getlength(picture) as photo_size from sh_photo;

so in photo_size showing all zeros instead +Ve number as picture inserted into.

please tell me where i am doing mistake....
Reply With Quote
  #2 (permalink)  
Old 07-22-09, 11:46
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
You're in a MySQL forum but showing Oracle code.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On