我正在尝试创建一个简单的过程以将图像插入数据库。
错误表明存在一些软链接,所以我用file
检查了文件,结果如下:
[oracle@term-2-15 home]$ file /home/oracle/laborki/champion_images
/home/oracle/laborki/champion_images: directory
[oracle@term-2-15 home]$ file /home/oracle/laborki/champion_images/ahri.jpg
/home/oracle/laborki/champion_images/ahri.jpg: JPEG image data, JFIF standard 1.01
我要在其中放置图片的表:
CREATE TABLE images (
id NUMBER PRIMARY KEY,
image ORDImage,
modified_image ORDImage,
image_name VARCHAR2(50)
);
这是我的程序:
CREATE OR REPLACE PROCEDURE LOAD_IMAGE (
image_name IN VARCHAR2,
directory_name IN VARCHAR2)
IS
ord_image ORDImage;
ctx RAW(64) := NULL;
row_id UROWID;
BEGIN
INSERT INTO images(image, image_name)
VALUES (ORDImage.init('FILE', directory_name, image_name), image_name)
RETURNING image, rowid INTO ord_image, row_id;
ord_image.import(ctx);
UPDATE images SET image = ord_image WHERE rowid = row_id;
END;
我怎么称呼
DECLARE
image_name VARCHAR2(8) := 'ahri.jpg';
directory_name VARCHAR2(50) := 'CHAMPION_IMAGES';
BEGIN
LOAD_IMAGE(image_name, directory_name);
END;
作为系统用户,我也这样做了:
CREATE OR REPLACE DIRECTORY champion_images AS '/home/oracle/laborki/champion_images';
Grant all on directory champion_images to bazy
当我调用程序时,我收到了该消息:
Error report -
ORA-22288: file or LOB operation FILEOPEN failed
soft link in path
ORA-06512: at "ORDSYS.ORDSOURCE", line 183
ORA-06512: at "SYS.DBMS_LOB", line 822
ORA-06512: at "ORDPLUGINS.ORDX_FILE_SOURCE", line 57
ORA-06512: at "ORDSYS.ORDSOURCE", line 164
ORA-06512: at "ORDSYS.ORDIMG_PKG", line 1215
ORA-06512: at "ORDSYS.ORDIMAGE", line 738
ORA-06512: at "BAZY.LOAD_IMAGE", line 12
ORA-06512: at line 5
22288. 00000 - "file or LOB operation %s failed\n%s"
*Cause: The operation attempted on the file or LOB failed.
*Action: See the next error message in the error stack for more detailed
information. Also, verify that the file or LOB exists and that
the necessary privileges are set for the specified operation. If
the error still persists, report the error to the DBA.
我没有找到任何软链接,所以我不确定实际上是什么错误。任何帮助将不胜感激。