Re: The use of the UTL_FILE package within PL/SQL [URGENT!!!]
Date: Mon, 21 Dec 1998 11:37:25 +0100
Message-ID: <367E24E5.9FCC92D3_at_zv.fhg.de>
Does your init.ora contains the entry utl_file_dir = c:\orawin95\bin ? Does the instance run on your PC? If not then you should use a directory on the server where the instance is running.
Urmila & Hazi Mistry schrieb:
>
> I seem to be having problems trying to use the FOPEN function from the
> UTL_FILE package provided by Oracle 7.3.3 - please help...
> I have tried the following PL/SQL on my client machine:
> DECLARE
> file_number utl_file.file_type;
> BEGIN
> file_number := utl_file.fopen('c:\orawin95\bin', 'text.txt', 'w');
Further you should use a exception handling like following for better error-messages:
EXCEPTION
WHEN UTL_FILE.INVALID_PATH THEN RAISE_APPLICATION_ERROR ( -20100 , 'FOpen: Invalid Path'||CHR(10)||SQLErrM ); WHEN UTL_FILE.INVALID_MODE THEN RAISE_APPLICATION_ERROR ( -20101 , 'FOpen: Invalid Mode'||CHR(10)||SQLErrM ); WHEN UTL_FILE.INVALID_OPERATION THEN RAISE_APPLICATION_ERROR ( -20102 , 'FOpen: Invalid Operation'||CHR(10)||SQLErrM );
> END;
> And get the following error messages:
> DECLARE
> *
> ERROR at line 1:
> ORA-06510: PL/SQL: unhandled user-defined exception
> ORA-06512: at "SYS.UTL_FILE", line 82
> ORA-06512: at "SYS.UTL_FILE", line 120
> ORA-06512: at line 4
> ANY IDEAS???
>
> Urmila
Hope this helps
-- MfG R.Wahl (ZV-807) ---------------------------------------------------- E-Mail_at_work: mailto:wahl_at_zv.fhg.de E-Mail_at_home: mailto:ReinhardWahl_at_online.de ---------------------------------------------------- Website http://www.online.de/homepages/ReinhardWahl ---------------------------------------------------- Hiermit widerspreche ich der Nutzung oder Uebermittlung meiner Daten fuer Werbezwecke oder fuer die Markt- oder Meinungsforschung gemaess Par. 28 Abs. 3 Bundesdatenschutzgesetz. ---------------------------------------------------- Please do not use my E-Mail address for advertising! ----------------------------------------------------Received on Mon Dec 21 1998 - 11:37:25 CET