I'm trying to uploade images into a table as written in the Oracle Documentation but I receive this error: ORA-22288: file or LOB operation FILEOPEN failed No such file or directory
I created a directory into /NetbeansProjects/Pinacoteca/opere. On Oracle, I created a directory FILE_DIR AS my_path_to_opere. I granted read to my_user.
But it doesn't work.
This is the procedure:
create or replace
PROCEDURE PRC_UPLOADIMAGE(image_id INTEGER, image_dir VARCHAR2, image_fname VARCHAR2)
AS
obj ORDIMAGE;
ctx RAW(64) := NULL;
BEGIN
INSERT INTO image_table VALUES(image_id,ORDImage.init());
SELECT i.image INTO obj FROM image_table i
WHERE i.id = image_id FOR UPDATE;
obj.importFrom(ctx,'file',image_dir,image_fname);
-- check size
DBMS_OUTPUT.PUT_LINE('Length is ' || obj.getContentLength());
DBMS_OUTPUT.PUT_LINE('Source is ' || obj.getSource());
UPDATE image_table i
SET i.image = obj
WHERE i.id = image_id;
COMMIT;
END PRC_UPLOADIMAGE;
Did you have the same problem?