ora-00439 while inserting blob image in a table. [message #136906] |
Mon, 12 September 2005 04:22 |
summisush
Messages: 19 Registered: September 2005 Location: mumbai
|
Junior Member |
|
|
hi friends again...
now i've got a new problem.
I've employee photos in my c:\photos.
I'm able to read this photos and display on the form using
read_image_file.
Now i've to save this image in table emp_img.
desc emp_img:
idcode char(6)
emp_img blob
i'm using the following code in when_button_pressed trigger.
DECLARE
l_blob BLOB;
l_bfile BFILE;
fname VARCHAR2(25);
BEGIN
fname := :mcard.idcode || '.jpg';
INSERT INTO EMP_IMG VALUES ( :mcard.idcode, EMPTY_BLOB() )returning EMP_IMG INTO l_blob;
l_bfile := BFILENAME( 'C:/PHOTOS', fname );
dbms_lob.fileopen( l_bfile );
dbms_lob.loadfromfile( l_blob, l_bfile,
dbms_lob.getlength( l_bfile ) );
dbms_lob.fileclose( l_bfile );
end;
but it is giving ora-00439 error.
Please help.
|
|
|
|
|
|
|
|
|
Re: ora-00439 while inserting blob image in a table. [message #137060 is a reply to message #137057] |
Tue, 13 September 2005 01:27 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Do you need the 'returning'?
The documentation says:
Quote: | Restrictions on the RETURNING Clause
You cannot:
Specify the returning_clause for a multitable insert.
Use this clause with parallel DML or with remote objects.
Retrieve LONG types with this clause.
Specify this clause for a view on which an INSTEAD OF trigger has been defined.
|
Does 'LONG' also include 'BLOB' and 'CLOB'?
David
[Updated on: Tue, 13 September 2005 01:30] Report message to a moderator
|
|
|
|
Re: ora-00439 while inserting blob image in a table. [message #137069 is a reply to message #137060] |
Tue, 13 September 2005 01:44 |
summisush
Messages: 19 Registered: September 2005 Location: mumbai
|
Junior Member |
|
|
sorry i didn't get you.
I've stored few photos on the server through a procedure whic is as follows.
CREATE OR REPLACE PROCEDURE Loadimage(idcode VARCHAR) AS
BEGIN
DECLARE
l_blob BLOB;
l_bfile BFILE;
fname VARCHAR2(25);
BEGIN
fname := idcode || '.jpg';
INSERT INTO EMP_IMG VALUES ( idcode, EMPTY_BLOB() ) returning EMP_IMG INTO l_blob;
l_bfile := BFILENAME( 'PHOTOS', fname );
dbms_lob.fileopen( l_bfile );
dbms_lob.loadfromfile( l_blob, l_bfile,
dbms_lob.getlength( l_bfile ) );
dbms_lob.fileclose( l_bfile );
END;
END;
/
i've my employee pics at \home\oracle\photos\
and from there i'm inserting into the database through this procedure.
This worked fine.
But i want to give this facility to my user through user interface ie. through forms 6.0
What ever photos were stored i'm able to fetch on the screen at runtime.
But for those employees who join afterwards and there photo in not in the database.I would like the administration people to feed their details and his/her photo too through my form.
In this case also should i first load the photo in \oracle\photos. or should i try from the local machine.
in my form i've tried saving an image from my local machine.
coz. according to documentation it doesn't store the image but a pointer to the address of the image.
i'm totally confused what to do...
|
|
|
|
Re: ora-00439 while inserting blob image in a table. [message #137073 is a reply to message #137071] |
Tue, 13 September 2005 01:55 |
summisush
Messages: 19 Registered: September 2005 Location: mumbai
|
Junior Member |
|
|
HI david...
Thanks for ur patience.
But i tried changing table name and column name too.
But same problem.
i created a test table named TEST as
id char(6)
photo blob
But i'm getting same error.
Any ways i'll try few more tricks...
Or else i'll continue storing images through the procedure.
Thanks once again for ur help.
|
|
|
Re: ora-00439 while inserting blob image in a table. [message #137074 is a reply to message #137073] |
Tue, 13 September 2005 01:59 |
summisush
Messages: 19 Registered: September 2005 Location: mumbai
|
Junior Member |
|
|
hi david once again.
the test program i made is now saving the image....
i removed all the codes and just wrote
commit_form;
and it is saving.
but commit is not working in the main form....coz. so many codes are there...
i'll try using commit there also.
hope my problem will be solved.
|
|
|