Home » RDBMS Server » Server Utilities » Urgent : UTL_FILE - Error
Urgent : UTL_FILE - Error [message #368264] Tue, 24 October 2000 05:46
Problem executing UTL_FIL
Messages: 2
Registered: October 2000
Junior Member
When I run the following script on a locally stored db, it works fine. However, if I execute on a server side db, I have the following error;

******************************************
SQL> @c:\bsp\excltrans_e.sql
declare
*
ERROR at line 1:
ORA-20003: INVALID_OPERATION: The file could not be opened or
operated on as requested.
ORA-06512: at line 29
******************************************

The server's drive letter is P: (on my PC) and I have initialised the init.ora/utl_file_dir parameter on the server as this;

utl_file_dir = \bsptest

The script as follows; Would appreciate some help. TIA
********************************************
declare
output utl_file.file_type;
begin
output := utl_file.fopen( 'p:\bsptest\', 'epoctrans.slk', 'w');
utl_file.fclose( output );
output := utl_file.fopen( 'p:\bsptest\', 'epoctrans.slk', 'w',32000);
owa_sylk.show(
p_file => output,
p_query => 'select * from scott.tblMailBoxData where CustAcNumber = :CustAcNumber',
p_parm_names =>
owa_sylk.owaSylkArray( 'CustAcNumber'),
p_parm_values =>
owa_sylk.owaSylkArray( '11318624' ),
p_show_grid => 'YES' );
utl_file.fclose( output );

exception
when utl_file.invalid_path then
raise_application_error(-20001,
'INVALID_PATH: File location or filename was invalid.');
when utl_file.invalid_mode then
raise_application_error(-20002,
'INVALID_MODE: The open_mode parameter in FOPEN was
invalid.');
when utl_file.invalid_filehandle then
raise_application_error(-20002,
'INVALID_FILEHANDLE: The file handle was invalid.');
when utl_file.invalid_operation then
raise_application_error(-20003,
'INVALID_OPERATION: The file could not be opened or
operated on as requested.');
when utl_file.read_error then
raise_application_error(-20004,
'READ_ERROR: An operating system error occurred during
the read operation.');
when utl_file.write_error then
raise_application_error(-20005,
'WRITE_ERROR: An operating system error occurred
during the write operation.');
when utl_file.internal_error then
raise_application_error(-20006,
'INTERNAL_ERROR: An unspecified error in PL/SQL.');
end;
/
********************************************
Previous Topic: sysdba password ??
Next Topic: Converting Date data in SQL Loader
Goto Forum:
  


Current Time: Fri Apr 19 15:53:17 CDT 2024