Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: URGENT: UTL_FILE Problem

Re: URGENT: UTL_FILE Problem

From: <markp7832_at_my-deja.com>
Date: Wed, 01 Dec 1999 17:58:30 GMT
Message-ID: <823nk4$mgv$1@nnrp1.deja.com>


In article <823j1i$iqk$1_at_nnrp1.deja.com>,   rock_cogar_at_my-deja.com wrote:
> Hi,
>
> I have a problem with UTL_FILE. I am running NT 4.0 sp5, with Oracle
> 8.1.5. I am working on the server itself, logged on as SYS (!).
>
> The Problem: No matter what I try the function UTL_FILE.FOPEN() fails
> with "Invalid path".
>
> Here is the script:
> -- ------------------------------------------------------------------
> DECLARE
>
> input_file utl_file.file_type;
> input_rec varchar2(200);
>
> begin
> input_file := utl_file.fopen ( 'g:/temp', 'Cars_y.fff', 'r');
>
> utl_file.get_line (input_file, input_rec);
>
> insert into imports.metadata (id, narrative1) values( 1,
> input_rec );
>
> utl_file.fclose(input_file);
> commit;
>
> exception
> when no_data_found
> then utl_file.fclose (input_file);
> when utl_file.internal_error
> then utl_file.fclose (input_file);
> raise_application_error(-20003,'Internal Error');
> when utl_file.invalid_filehandle
> then utl_file.fclose (input_file);
> raise_application_error(-20003,'Invalid file
> handle'); when utl_file.invalid_operation
> then utl_file.fclose (input_file);
> raise_application_error(-20003,'Invalid
> operation'); when utl_file.invalid_path
> then utl_file.fclose (input_file);
> raise_application_error(-20003,'Invalid path');
> when utl_file.read_error
> then utl_file.fclose (input_file);
> raise_application_error(-20003,'Read error'); when
> utl_file.write_error
> then utl_file.fclose (input_file);
> raise_application_error(-20003,'Write error');
when
> value_error
> then utl_file.fclose (input_file);
> raise_application_error(-20003,'Value error');
when
> others
> then utl_file.fclose (input_file);
>
> raise_application_error(-20002,To_Char(SQLCODE)||SQLERRM);
>
> end;
>
> Thanks,
> Rock Cogar.
> Radian International LLC.
> Oak Ridge, TN. USA.
>

Rock, generic question since I do not work with NT. Did you set the utl_file directory parameter in the init.ora file (or since you are NT you may need or be able to set it in the Registry)?

--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Dec 01 1999 - 11:58:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US