0

First of all i am very new with database systems. i am trying to store an image on my db (only for testing purposes) however I cannot do. There is a problem in the code I use. Can you please tell me what is wrong with the following code?

Create DIRECTORY temp as 'c:\temp';

DECLARE
  src_lob  BFILE := BFILENAME('temp', 'IMAGE.png');
  dest_lob BLOB;
BEGIN
  INSERT INTO lob_table VALUES(2, EMPTY_BLOB())
     RETURNING doc INTO dest_lob;

  DBMS_LOB.OPEN(src_lob, DBMS_LOB.LOB_READONLY);
  DBMS_LOB.LoadFromFile( DEST_LOB => dest_lob,
                         SRC_LOB  => src_lob,
                         AMOUNT   => DBMS_LOB.GETLENGTH(src_lob) );
  DBMS_LOB.CLOSE(src_lob);

  COMMIT;
END;

When I try to run it, I have the following error: ORA-00911: invalid character

What is wrong here?

Thannks in advance.

1
  • @cagcowboy I don't know, ORA-00911: invalid character is the only error message shown Commented Jun 7, 2011 at 15:23

1 Answer 1

1

Never done it so I'm not certain, but I think the DIRECTORY has to be on the server, not the client.

(You may be running SQL*Plus on the server I guess)

Sign up to request clarification or add additional context in comments.

1 Comment

server and client are the sane machine (my pc)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.