Home » RDBMS Server » Server Administration » Want more info about Raise_Application_Error Func.
Want more info about Raise_Application_Error Func. [message #370431] Thu, 23 September 1999 16:27 Go to next message
Richard Dharmaraj
Messages: 4
Registered: September 1999
Junior Member
Hi Friends,

I need help in using Raise_Application_Error Func.
Re: Want more info about Raise_Application_Error Func. [message #370433 is a reply to message #370431] Fri, 24 September 1999 09:10 Go to previous messageGo to next message
Mario
Messages: 10
Registered: September 1999
Junior Member
Here's an example of how I use it:

PROCEDURE toto
IS
f UTL_FILE.FILE_TYPE := NULL;
step VARCHAR(200);

BEGIN
step := 'Step 1 : FOPEN ';
f := UTL_FILE.FOPEN('/develop/rtdas/v6.0/log', 'toto.txt', 'a');
step := 'Step 2 : PUT_LINE ';
UTL_FILE.PUT_LINE(f, 'test from toto ' || sysdate);
step := 'Step 3 : FCLOSE ';
UTL_FILE.FCLOSE(f);
step := 'Step 4 : end ';

EXCEPTION
WHEN UTL_FILE.INVALID_PATH THEN
RAISE_APPLICATION_ERROR(-20000, step || ' : INVALID_PATH');

WHEN UTL_FILE.INVALID_MODE THEN
RAISE_APPLICATION_ERROR(-20000, step || ' : INVALID_MODE');

WHEN UTL_FILE.INVALID_FILEHANDLE THEN
RAISE_APPLICATION_ERROR(-20000, step || ' : INVALID_FILEHANDLE');

WHEN UTL_FILE.INVALID_OPERATION THEN
RAISE_APPLICATION_ERROR(-20000, step || ' : INVALID_OPERATION');

WHEN UTL_FILE.READ_ERROR THEN
RAISE_APPLICATION_ERROR(-20000, step || ' : READ_ERROR');

WHEN UTL_FILE.WRITE_ERROR THEN
RAISE_APPLICATION_ERROR(-20000, step || ' : WRITE_ERROR');

WHEN UTL_FILE.INTERNAL_ERROR THEN
RAISE_APPLICATION_ERROR(-20000, step || ' : INTERNAL_ERROR');

WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20000, step || TO_CHAR(SQLCODE) || ': ' || SQLERRM);
END toto;
Re: Want more info about Raise_Application_Error Func. [message #370455 is a reply to message #370431] Sun, 26 September 1999 13:13 Go to previous message
sonik chopra
Messages: 4
Registered: September 1999
Junior Member
##2####!!

f$$#@@

DSR%55^%%^%
Previous Topic: Re: triggers and sequences
Next Topic: is it possible to run UNIX command from PL/SQL procedure
Goto Forum:
  


Current Time: Tue Oct 20 09:05:29 CDT 2020