Oracle无法读取ORDImage的图片

时间:2018-03-21 14:33:48

标签: oracle plsql oracle11g

我有以下目录来存储图像。

create or replace directory TEST AS '\home\oracle';

在这个文件夹中我有图片名称'Pojazd.png'。 我hava试图通过以下脚本将这些图像加载到数据库中。

DECLARE
  l_image      ORDImage;
  l_ctx        RAW(4000)    := NULL;
  l_file_name  VARCHAR2(10) := 'Pojazd.png';
BEGIN
  INSERT INTO foto_oferty (idk,nazwa_pliku,obrazek,oferta_id)
  VALUES (1,l_file_name,ORDSYS.ORDImage.init(),1);

  SELECT obrazek
  INTO   l_image
  FROM   foto_oferty
  WHERE  nazwa_pliku = l_file_name
  FOR UPDATE;

  -- Import the image into the database
  l_image.importFrom(l_ctx, 'file', 'TEST', 'Pojazd.png');

  UPDATE foto_oferty
  SET    obrazek     = l_image
  WHERE  nazwa_pliku = l_file_name;
  COMMIT;
END;
/

但是我收到以下错误消息。

ORA-22288: file or LOB operation FILEOPEN failed
No such file or directory
22288. 00000 -  "file or LOB operation %s failed\n%s"
*Cause:    The operation attempted on the file or LOB failed.

我不明白这是什么原因。我已经定义了存在的路径和文件。我使用的是virtualbox和oracle 11g机器。

enter image description here

0 个答案:

没有答案
相关问题