Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

import BLOB record related

Biswajit Goutam BharadwajJan 23 2020 — edited Feb 15 2020

Hi Oracle Technologist,

I am using Oracle 19c.

I want to import some BLOB record by below script.but i am getting some error.

-----------------

CREATE OR REPLACE DIRECTORY BLOB_DIR AS '/home/oracle/';

-----------------------------

CREATE TABLE tab1 (

  id NUMBER,

  blob_data BLOB

);

----------------------------------

DECLARE

  l_bfile  BFILE;

  l_blob   BLOB;

  l_dest_offset INTEGER := 1;

  l_src_offset  INTEGER := 1;

BEGIN

  INSERT INTO tab1 (id, blob_data)

  VALUES (1, empty_blob())

  RETURN blob_data INTO l_blob;

  l_bfile := BFILENAME('BLOB_DIR', '/home/oracle/MyImage.jpg');

  DBMS_LOB.fileopen(l_bfile, DBMS_LOB.file_readonly);

  -- loadfromfile deprecated.

  -- DBMS_LOB.loadfromfile(l_blob, l_bfile, DBMS_LOB.getlength(l_bfile));

  DBMS_LOB.loadblobfromfile (

    dest_lob    => l_blob,

    src_bfile   => l_bfile,

    amount      => DBMS_LOB.lobmaxsize,

    dest_offset => l_dest_offset,

    src_offset  => l_src_offset);

  DBMS_LOB.fileclose(l_bfile);

  COMMIT;

END;

/

-------------------

Error report -

ORA-22288: file or LOB operation FILEOPEN failed

soft link in path

ORA-06512: at "SYS.DBMS_LOB", line 822

ORA-06512: at line 23

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.

**************************

please help.

thanks,

goutam

This post has been answered by Paulzip on Jan 23 2020
Jump to Answer
Comments
Post Details
Added on Jan 23 2020
6 comments
968 views