Home » SQL & PL/SQL » SQL & PL/SQL » Error while opening file(ORA-22288) (ORACLE 6I, XP)
Error while opening file(ORA-22288) [message #430328] Tue, 10 November 2009 01:58 Go to next message
sajinndd
Messages: 1
Registered: June 2008
Location: Cochin
Junior Member

Please help me...
I have to write to a clob column. i had write a procedure in the backend using dbms_lob package. But i cant locate the specified path for reading the file.

declare
l_clob clob;
l_bfile bfile := bfilename('BFILES_DIR2', 'y.txt');

-- l_bfile bfile := bfilename('MY_DIR', 'b.txt');
begin
update gn_defaults set eula_body = empty_clob();
select eula_body into l_clob from gn_defaults for update;
dbms_output.put_line(dbms_lob.fileexists( l_bfile ));
if dbms_lob.fileexists( l_bfile ) = 1 then
dbms_lob.open(l_clob,dbms_lob.lob_readwrite);
dbms_lob.fileopen(l_bfile,dbms_lob.file_readonly);
dbms_lob.loadfromfile( l_clob, l_bfile,dbms_lob.getlength( l_bfile ) );
dbms_lob.close(l_bfile);
dbms_lob.close(l_clob);
end if;

EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
DBMS_LOB.CLOSE(l_bfile);
DBMS_LOB.CLOSE(l_clob);
end;
Re: Error while opening file(ORA-22288) [message #430330 is a reply to message #430328] Tue, 10 November 2009 02:04 Go to previous messageGo to next message
ThomasG
Messages: 3184
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
SELECT * FROM dba_directories;


To see which directories are already created.

If you need/want a new one create it with the create directory statement.
Re: Error while opening file(ORA-22288) [message #430337 is a reply to message #430328] Tue, 10 November 2009 02:33 Go to previous message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ORA-22288: file or LOB operation %s failed\n%s
 *Cause: The operation attempted on the file or LOB failed.
 *Action: See the next error message in the error stack for more detailed
          information.  Also, verify that the file or LOB exists and that
          the necessary privileges are set for the specified operation. If
          the error still persists, report the error to the DBA

If you post a RAISE statement instead of dbms_output you'd know what is the next message.

Regards
Michel
Previous Topic: Question on error handling
Next Topic: put results of dynamic sql into pl/sql statements
Goto Forum:
  


Current Time: Sun Sep 25 14:31:36 CDT 2016

Total time taken to generate the page: 0.39051 seconds