Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> bfile basics

bfile basics

From: Michael Boligan <mboligan_at_healthvision.com>
Date: Wed, 31 May 2000 15:34:20 -0400
Message-Id: <10514.107351@fatcity.com>

        I am having a problem with bfiles. I have read the docs, but I must have missed something. Thanks in advance for any help.

Environment:

	Server:  	NT 4.0 SP5
	Database:  	Oracle 8.1.5.0.0


   I am successfully (so it seems) inserting the bfile into the table. When I try to use the dbms_lob.fileopen procedure I get the following error:

	SQL> set serveroutput on size 1000000
	SQL> declare
	  2  bf bfile;
	  3  dir_al  varchar2(30);
	  4  name varchar2(2000);
	  5  begin
	  6  select col2 into bf from table2 where col1 =1;
	  7  dbms_lob.filegetname(bf,dir_al,name);
	  8  dbms_output.put_line('opening '|| dir_al ||name);
	  9  dbms_lob.fileopen(bf, dbms_lob.file_readonly);
	 10  end;
	 11  /
	opening bfdir2move.doc
	declare
	*
	ERROR at line 1:
	ORA-22285: non-existent directory or file for FILEOPEN operation
	ORA-06512: at "SYS.DBMS_LOB", line 475
	ORA-06512: at line 9


	SQL> 

Below is the setup information:

        Created the directory c:\bfdir2 and put the file move.doc there.

	create table table2
	(col1  number(2),
	col2   bfile);

	create directory bfdir2 as 'C:\bfdir2';

	insert into table2 values (2,bfilename('bfdir2','move.doc'));
	commit;

	SQL> select col1 from table2;

	     COL1
	---------
	        1

	SQL> desc table2
	 Name                                                  Null?    Type
	 ----------------------------------------------------- --------
------------------------------------
Received on Wed May 31 2000 - 14:34:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US