Re: BFILE with Oracle 8i on Windows NT?

From: Finn Ellebaek Nielsen <fen_at_changegroup.dk>
Date: Sat, 3 Jul 1999 14:37:18 +0100
Message-ID: <7ll06q$4qa$1_at_news.inet.tele.dk>


[Quoted] Hi Rob.

Your example is quite incorrect. You have to use a backslash instead of a slash in the directory name, first argument for BFILENAME must always be in upper case (stupid, but that's the way it it, it looks in the Data [Quoted] Dictionary for the directory with the given name), the return code from FILEXISTS is 1 for success, so check with >= 1, and you have used C syntax for the if statement.

This should work:

create directory my_dir as 'c:\temp';

declare
  osFile BFILE := BFILENAME('MY_DIR', 'doc1.txt');   rc INTEGER;
begin
  rc := dbms_lob.FILEEXISTS( osFile );
  if rc >= 1 then
    dbms_output.put_line ('yes');
  else
    dbms_output.put_line ('no');
  end if;
end;
/

HTH. Finn

Rob Mitchell <rjmitchell_at_mediaone.net> wrote in message news:zrBe3.2000$kL2.140131_at_ndnws01.ne.mediaone.net...
> Hello,
>
> Can anyone get BFILEs to work on Oracle 8i with Windows NT?
>
>
> SQL> create directory my_dir for 'c:/temp';
>
> OK
>
> SQL> declare
> osFile BFILE := BFILENAME('my_dir', 'doc1.txt');
> rc INTEGER;
> begin
> rc := dbms_lob.FILEEXISTS( osFile );
> if (rc > 1)
> dbms_output.put_line ('yes');
> else
> dbms_output.put_line ('no');
> end if;
> end;
>
>
>
>
> ---
> Rob Mitchell
> rjmitchell_at_mediaone.net
> Base Class Technologies, Inc.
>
>
>
>
Received on Sat Jul 03 1999 - 15:37:18 CEST

Original text of this message