Home » SQL & PL/SQL » SQL & PL/SQL » problem with image (merged)
problem with image (merged) [message #272803] Sun, 07 October 2007 11:12 Go to next message
RyjuRaju
Messages: 48
Registered: September 2007
Member
Hi
can anyone help me to solve the error "invalid file location,can't be opened". I am trying to insert an image file into a table.I am using a CENTOS system(similar to linux) and my image file is in desktop.The properties of the file shows the location as
'/home/oracle/Desktop'.But an error is showing.I am not familiar with linux file location and path.Can anyone help me?

many thanks
Ryju
Re: problem with the location of image file [message #272806 is a reply to message #272803] Sun, 07 October 2007 12:38 Go to previous messageGo to next message
RyjuRaju
Messages: 48
Registered: September 2007
Member
The problem is solved with adding root.Thanks anyway.
problem with inserting image [message #272807 is a reply to message #272803] Sun, 07 October 2007 12:50 Go to previous messageGo to next message
RyjuRaju
Messages: 48
Registered: September 2007
Member
Hi
i have got a problem while inserting an image into a table containing blob column.
 CREATE OR REPLACE DIRECTORY images AS '/root/home/oracle/Desktop';
/
DECLARE
 l_bfile  BFILE;
 l_blob   BLOB;

BEGIN
 INSERT INTO HTMLDB_APPLICATION_FILES (name, blob_content)
 VALUES ( 'receipt1.gif', empty_blob())
 RETURN blob_content INTO l_blob;

 l_bfile := BFILENAME('IMAGES', 'receipt1.gif');
 DBMS_LOB.fileopen(l_bfile, Dbms_Lob.File_Readonly);
 DBMS_LOB.loadfromfile(l_blob, l_bfile, DBMS_LOB.getlength(l_bfile));
 DBMS_LOB.fileclose(l_bfile);

UPDATE EXPENSEITEM
SET EXPRECIMG=(SELECT  BLOB_CONTENT
FROM HTMLDB_APPLICATION_FILES
WHERE name ='receipt1.gif') , EXPRECID=(SELECT  ID
FROM HTMLDB_APPLICATION_FILES
WHERE name ='receipt1.gif')
WHERE EINO=2;
 COMMIT;
END;
/ 

the error is "File or lob operation FILEOPEN failed.Permission denied.
I have given permmision "create any directory" to this user.
Still error is showing.
Can anyone help me?
Re: problem with inserting image [message #272809 is a reply to message #272807] Sun, 07 October 2007 13:28 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>Still error is showing.
Error? what error? I don't see any error.

>Can anyone help me?
More than likely is it an Operating System permission issue, but insufficient details have been provided.
Re: problem with inserting image [message #272810 is a reply to message #272807] Sun, 07 October 2007 13:41 Go to previous messageGo to next message
RyjuRaju
Messages: 48
Registered: September 2007
Member
Hi
i have to add a image file from centos system to a table called expenseitem.I tried the above query and i dont know what permission i have to give more.i have already given create directory permission.Another intersting thing i found is if i change the eino to 1 which is not valid column data,it shows no error for the fist time but nothing happened(no image inserted.)But for the second time,same error occured.Any ideas
Thanks
Ryju
Re: problem with image (merged) [message #272841 is a reply to message #272803] Mon, 08 October 2007 00:15 Go to previous message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Create any directory actually give a logical name to oracle. Or , you can say alias of an existing directory. You must have explicit OS permission of the directory to access objects underlying directory.
Previous Topic: How Come There is No Error
Next Topic: Service name
Goto Forum:
  


Current Time: Thu Dec 08 18:05:08 CST 2016

Total time taken to generate the page: 0.11208 seconds