Thread: error notification for process

This question is answered.


Permlink Replies: 6 - Pages: 1 - Last Post: Oct 1, 2008 10:41 AM Last Post By: sspadafo
Markus Taubek

Posts: 55
Registered: 09/08/08
error notification for process
Posted: Oct 1, 2008 4:35 AM
 
Click to report abuse...   Click to reply to this thread Reply
Hello

I have a pl sql process, and catch an exception in the code.

If the Process ready and is an exception thrown I get an success- instead of an error notification.
How I can activate the error notification after catching exception?

thanks for any help

markus
John Vaughan

Posts: 190
Registered: 01/10/06
Re: error notification for process
Posted: Oct 1, 2008 4:55 AM   in response to: Markus Taubek in response to: Markus Taubek
Correct
Click to report abuse...   Click to reply to this thread Reply
Markus - the error text you set for the process is displayed only if the process itself fails. If you handle errors within it, the process succeeds and you get the success message.

I'd be interested to hear what others are doing, but we have done this kind of thing:

Create a hidden page item, e.g. P1_MESSAGE.

Set the value of that item from within your PL/SQL process, e.g:

...
exception
  when others then
    :P1_MESSAGE := 'Error text here';
end;


The set the success text to &P1_MESSAGE. (with the trailing full stop).

Does that do what you want?

John.
Markus Taubek

Posts: 55
Registered: 09/08/08
Re: error notification for process
Posted: Oct 1, 2008 5:10 AM   in response to: John Vaughan in response to: John Vaughan
 
Click to report abuse...   Click to reply to this thread Reply
yeah.. that solution sounds good
thanks
Markus Taubek

Posts: 55
Registered: 09/08/08
Re: error notification for process
Posted: Oct 1, 2008 5:19 AM   in response to: Markus Taubek in response to: Markus Taubek
 
Click to report abuse...   Click to reply to this thread Reply
mhm ok its good.. but not perfect :-)
because.. If I want do messages globalize in different languages,
so this message dont include, at least I have to do it manually in code

Is there no opportunity to kill the process?
So that the process will not run successfully..
maybe a kind of "return -1" or something like this??
John Vaughan

Posts: 190
Registered: 01/10/06
Re: error notification for process
Posted: Oct 1, 2008 5:42 AM   in response to: Markus Taubek in response to: Markus Taubek
 
Click to report abuse...   Click to reply to this thread Reply
I suppose you could re-raise an error for specific exceptions, i.e:

raise_application_error(-20000, 'Error text')


John
Markus Taubek

Posts: 55
Registered: 09/08/08
Re: error notification for process
Posted: Oct 1, 2008 6:48 AM   in response to: John Vaughan in response to: John Vaughan
 
Click to report abuse...   Click to reply to this thread Reply
ok that works..
but now if I raise the application with an error, I get an error page with ora-2000... and so on...
but I dont like that page...
I want to go forward to my generally page flow..
and with the generally notification, but with the error notification instaead of the success notification..

Because I think the user is not happy with that ORA-2000 failure page.

Do you have a solution?
sspadafo

Posts: 16,581
Registered: 01/10/01
Re: error notification for process
Posted: Oct 1, 2008 10:41 AM   in response to: Markus Taubek in response to: Markus Taubek
Helpful
Click to report abuse...   Click to reply to this thread Reply
Markus,

You can add the following code to your process to redirect to an error page set up to format the information any way you like:

apex_application.g_unrecoverable_error := true;
owa_util.redirect_url('f?p=' || :APP_ID || ':' || <page ID of your custom error display page> || ':' || :APP_SESSION || '::NO::' || et cetera ... );

Scott
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums