Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DIRECTORIES and BFILE problems
JavaDeveloper wrote:
>
>
> INSERT INTO MYTABLE (BFILE_COLUMN)
> VALUES ( bfilename ('TEMP_DIR', 'binaryfile.dat'))
>
This command does *not* load the Bfile into the database. Intstead it tells Oracle that there is a file called 'binaryfile.dat' in the directory 'TEMP_DIR' on the same computer that is running the Oracle server software.
> After these steps, controlling the table with a graphical DB tool (i.e.
> Toad), I see that in the BFILE column, after the name of the file loaded,
> there is a notice like "NoExist".
> Reading that BFILE in my Java program, I find out that the file length is 73
> bytes instead of 40 Kb!!!
> The file does not exist!!!
> My question is... why???
>
The 73 bytes is how much space Oracle takes to store the name of the directory and the name of the file. BFILE's arent stored *in* the database. If you want to do that and aren't on the database server machine use BLOB or CLOB.
> Note: Le DB is not in my computer, but the file binaryfile.dat is my local
> file system. Maybe, the loading works only on the same file system of the
> DB?? I hope not! :-)
>
> Thanks
>
> Matt
>
You can do one of the following things:
David Rolfe
Orinda Software
Dublin, Ireland
Makers of OrindaBuild, which writes Java to run PL/SQL procedures. Received on Thu Mar 03 2005 - 04:38:14 CST