Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> REPOST: BFILES
I am attempting to use BFILE columns to reference existing files on a
windows XP workstation. At present the Server and client are on same
workstation.
I will be using OO4 to provide user interface but cannot get the PL/SQL interface to work. I have created a "DIRECTORY" and give READ permissions to public. I can update the BFILE column in the database but when I attempt to see if the file exists I get an error.
If I run the following:
declare
xx bfile;
DIR_ALIAS VARCHAR2(30); -- size required
FILENAME VARCHAR2(30); -- size required
begin
UPDATE lsobj.WITHBFILE
SET COLBFILE = BFILENAME('DIR1','Test1.txt')
WHERE COL1 = 1;
select colbfile into xx from lsobj.withbfile where col1 =1;
DBMS_LOB.FILEGETNAME(FILE_LOC => XX ,DIR_ALIAS => DIR_ALIAS ,FILENAME =>
FILENAME);
DBMS_OUTPUT.PUT_LINE(DIR_ALIAS);
DBMS_OUTPUT.PUT_LINE(FILENAME);
IF (DBMS_LOB.FILEEXISTS(xx) != 0)
THEN
DBMS_OUTPUT.PUT_LINE('Processing given that the BFILE exists');
ELSE
DBMS_OUTPUT.PUT_LINE('Processing given that the BFILE does not exist');
END IF;
UPDATE lsobj.WITHBFILE
SET COLBFILE = BFILENAME('C:\TEST','Test1.txt')
WHERE COL1 = 1;
select colbfile into xx from lsobj.withbfile where col1 =1;
DBMS_LOB.FILEGETNAME(FILE_LOC => XX ,DIR_ALIAS => DIR_ALIAS ,FILENAME =>
FILENAME);
DBMS_OUTPUT.PUT_LINE(DIR_ALIAS);
DBMS_OUTPUT.PUT_LINE(FILENAME);
IF (DBMS_LOB.FILEEXISTS(xx) != 0)
THEN
DBMS_OUTPUT.PUT_LINE('Processing given that the BFILE exists');
ELSE
DBMS_OUTPUT.PUT_LINE('Processing given that the BFILE does not exist');
END IF;
end;
I get the following output:
DBMS_OUTPUT :
DIR1
Test1.txt
Processing given that the BFILE does not exist
C:\TEST
Test1.txt
ORA-22285: non-existent directory or file for FILEEXISTS operation ORA-06512: at "SYS.DBMS_LOB", line 456 ORA-06512: at line 35
Neither situation is working. I cannot use either the absolute path (not preferable) or a DIRECTORY.
Any ideas?
Lloyd Sheen
This message was cancelled from within The Unacanceller's glorious new software, Lotus 1-2-3 For Rogue Cancellers. Received on Sun Jan 27 2002 - 18:29:33 CST
![]() |
![]() |