Home » Server Options » Text & interMedia » Error in loading blob
Error in loading blob [message #76108] Wed, 18 August 2004 20:53 Go to next message
Muneer
Messages: 3
Registered: July 2002
Junior Member
i am trying to load blob to a column for testing Oracle text. following is what I did-

CREATE TABLE my_docs (
  id    NUMBER(10)     NOT NULL,
  name  VARCHAR2(200)  NOT NULL,
  doc   BLOB           NOT NULL
)
/

ALTER TABLE my_docs ADD (
  CONSTRAINT my_docs_pk PRIMARY KEY (id)
)
/

CREATE SEQUENCE my_docs_seq;

CREATE OR REPLACE DIRECTORY documents AS 'C:work';

CREATE OR REPLACE PROCEDURE load_file_to_my_docs (p_file_name  IN  my_docs.name%TYPE) AS
  v_bfile      BFILE;
  v_blob       BLOB;
BEGIN
  INSERT INTO my_docs (id, name, doc)
  VALUES (my_docs_seq.NEXTVAL, p_file_name, empty_blob())
  RETURN doc INTO v_blob;

  v_bfile := BFILENAME('DOCUMENTS', p_file_name);
  Dbms_Lob.Fileopen(v_bfile, Dbms_Lob.File_Readonly);
  Dbms_Lob.Loadfromfile(v_blob, v_bfile, Dbms_Lob.Getlength(v_bfile));
  Dbms_Lob.Fileclose(v_bfile);

  COMMIT;
END;
/

EXEC load_file_to_my_docs('doc1.doc');

I am getting the following error

*
ERROR at line 1:
ORA-22288: file or LOB operation FILEOPEN failed
The system cannot find the path specified.
ORA-06512: at "SYS.DBMS_LOB", line 504
ORA-06512: at "SCOTT.LOAD_FILE_TO_MY_DOCS", line 10
ORA-06512: at line 1

The directory and documents are available in the system. So what could be the reason for this error. Kindly help me and thanks in advance.

Rgds

Muneer
Re: Error in loading blob [message #76110 is a reply to message #76108] Mon, 23 August 2004 01:51 Go to previous message
Logesh D
Messages: 2
Registered: August 2004
Junior Member
Hi,
If your working in client and server mode this may be a problem.
The error is in this line of code CREATE OR REPLACE DIRECTORY documents AS 'C:work';
here documents is logical name for physical directory c:work
so this c:work physical directory should be there in the server side where the oracle server is installed not in client machine
and one more your doc1.doc should be in the c:work directory

Regards
Logesh D
Previous Topic: InterMedia Text on RH Linux 2.1 (Itanium)
Next Topic: Installing InterMedia on Oracle 8.1.7.4.0
Goto Forum:
  


Current Time: Thu Mar 28 15:08:26 CDT 2024