Home » Developer & Programmer » Forms » ora-00439 while inserting blob image in a table.
ora-00439 while inserting blob image in a table. [message #136906] Mon, 12 September 2005 04:22 Go to next message
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 #137029 is a reply to message #136906] Mon, 12 September 2005 19:08 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
1) Is this the full message that you received "ORA-00439 feature not enabled: string"?

2) What version of database are you running?

David

[Updated on: Tue, 13 September 2005 00:22]

Report message to a moderator

Re: ora-00439 while inserting blob image in a table. [message #137043 is a reply to message #136906] Mon, 12 September 2005 23:43 Go to previous messageGo to next message
summisush
Messages: 19
Registered: September 2005
Location: mumbai
Junior Member
i'm using form 6.0 and oracle 8
Re: ora-00439 while inserting blob image in a table. [message #137050 is a reply to message #137043] Tue, 13 September 2005 00:25 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Thank you for answering question #2.

Please answer question #1 giving the whole message that you receive.

Please put a 'message('stmt nn');pause;' command pair between each line of your code, increment the 'nn' string, and tell us at which command, exactly, your code is failing.

David
Re: ora-00439 while inserting blob image in a table. [message #137054 is a reply to message #137050] Tue, 13 September 2005 00:51 Go to previous messageGo to next message
summisush
Messages: 19
Registered: September 2005
Location: mumbai
Junior Member
it gives the error WHEN-BUTTON-PRESSED trigger raised unhandled exception ora-00439.

error appears at insert statement.
Re: ora-00439 while inserting blob image in a table. [message #137055 is a reply to message #137054] Tue, 13 September 2005 01:09 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please confirm that

1) :mcard.idcode is a character field.
2) the value in :mcard.idcode does not currently exist in the table emp_img
3) please list the REAL code that you are using. Currently, you have your blob object (emp_img) having the same name as your table object (emp_img).

David
Re: ora-00439 while inserting blob image in a table. [message #137057 is a reply to message #137055] Tue, 13 September 2005 01:19 Go to previous messageGo to next message
summisush
Messages: 19
Registered: September 2005
Location: mumbai
Junior Member
1. :mcard.idcode is character in my form.
2. value i'm passing is not present in the table.
3. blob column name and my table name is same as emp_img.

But that is not the problem i think, coz. i created a test table with photo as blob item.
but i'm getting same problem.

i'll upload the test program, where i'm getting the same problem.
may be this will explain my problem more clearly.
  • Attachment: test.fmb
    (Size: 40.00KB, Downloaded 1400 times)
Re: ora-00439 while inserting blob image in a table. [message #137060 is a reply to message #137057] Tue, 13 September 2005 01:27 Go to previous messageGo to next message
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 #137063 is a reply to message #137060] Tue, 13 September 2005 01:33 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I did a google search on 'insert returning blob'. Try it. When I find a good example I will update this post.

This one http://www.psoug.org/reference/utl_compress.html looks exactly like you have asked.

This one http://www.unix.org.ua/orelly/oracle/prog2/ch13_02.htm makes me feel that you don't need the 'returning'.

Try changing the field name or the table name.

David

[Updated on: Tue, 13 September 2005 01:38]

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 Go to previous messageGo to next message
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 #137071 is a reply to message #137069] Tue, 13 September 2005 01:50 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Having the column name and the table name the same, for me, is an unwise action. Change either the table name or column name to something different.

I have no other ideas to share with you. Hopefully, someone else will have an idea.

David
Re: ora-00439 while inserting blob image in a table. [message #137073 is a reply to message #137071] Tue, 13 September 2005 01:55 Go to previous messageGo to next message
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 Go to previous message
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.

Previous Topic: examples
Next Topic: how to protect selecting same row from the LOV..........
Goto Forum:
  


Current Time: Fri Sep 20 05:30:04 CDT 2024