Home » SQL & PL/SQL » SQL & PL/SQL » utl_file
utl_file [message #441332] Sat, 30 January 2010 23:10 Go to next message
prakashaa
Messages: 31
Registered: November 2009
Location: Bangalore
Member
Hi Experts,

How can we handle exceptions in UTL_FILE without using
WHEN OTHERS cluse.
Please help me.
Re: utl_file [message #441334 is a reply to message #441332] Sat, 30 January 2010 23:16 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

Each error is handled individually as below
 EXCEPTION
           WHEN NO_DATA_FOUND THEN
              DBMS_OUTPUT.PUT_LINE('no_data_found');
              UTL_FILE.FCLOSE(file_handle);
           WHEN UTL_FILE.INVALID_PATH THEN
              DBMS_OUTPUT.PUT_LINE('UTL_FILE.INVALID_PATH');
              UTL_FILE.FCLOSE(file_handle);
           WHEN UTL_FILE.READ_ERROR THEN
              DBMS_OUTPUT.PUT_LINE(' UTL_FILE.READ_ERROR');
              UTL_FILE.FCLOSE(file_handle);
           WHEN UTL_FILE.WRITE_ERROR THEN
              DBMS_OUTPUT.PUT_LINE('UTL_FILE.WRITE_ERROR');
              UTL_FILE.FCLOSE(file_handle);
Re: utl_file [message #441352 is a reply to message #441332] Sun, 31 January 2010 00:12 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Do you mean that you want to use the pre-defined exceptions for utl_file?
If so, check this.

By
Vamsi
Re: utl_file [message #441359 is a reply to message #441332] Sun, 31 January 2010 00:33 Go to previous message
Michel Cadot
Messages: 64137
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
In addition:
Database PL/SQL Packages and Types Reference
Chapter UTL_FILE
Section Exceptions

Regards
Michel
Previous Topic: Materialized views
Next Topic: How to display only details of group by query
Goto Forum:
  


Current Time: Thu Dec 08 06:24:07 CST 2016

Total time taken to generate the page: 0.22277 seconds