| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: The use of the UTL_FILE package within PL/SQL [URGENT!!!]
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
);
--
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.
![]() |
![]() |