Trigger Showing Alert Message

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
Post Reply
celsobtu
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 7
Joined: Thu, 23 Mar 2006 11:23 am
Location: Botucatu - SP

Greetings !!!
Dear colleagues, I'm picking up to make Oracle display an informational message to the user, only informative. I do not want to lock anything ... just alert the user.
I did like this ...:
--------------------------------- -----------------------------------------------

Select all

 
create or replace trigger MostraAviso 
  before insert on tabelaX 
  for each row 
declare 
  -- local variables here 
begin 
 
---MSG DE AVISO 
   If (:new.ati_in_codigo in (3)) Then 
       raise_application_error(-20001,'..ATENÇÃO ! Produto Tóxico !'); 
   end if;   
END;   
------------------------------------------- ---------------------------------------
This way I did. .. the message is in loop ... this is the user clicks on ok .... and the message back on the screen .....

someone has any idea how to solve I can resolve this ...?
Thanks for the attention ....
Celsobtu
kellcristina
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 4
Joined: Mon, 28 Apr 2008 11:36 am
Location: São Paulo

Celso,

Did you manage to display informational message?
had any other alternative?
I am also trying, but should not abort the inclusion / change of data.

Thanks!
Kelly
rodfbar
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 241
Joined: Tue, 09 Oct 2007 11:15 am
Location: Batatais - SP

The message return from the trigger by the raise_application_error is returning to the application that the insert is with error, so it aborts the other insertions ...

return the messages at trigger level and include I unknown ...
I believe that you need to validate this message at application level ... along with your insert

abcs ..
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Or, another tip also ...
Play the value of this MSG in a log table, let the process continue and, at the end, in the application, display a window with this information ...
Whatever, send it there.
kellcristina
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 4
Joined: Mon, 28 Apr 2008 11:36 am
Location: São Paulo

Hi guys!

As it is a non-custom application and there was no field available for viewing the message We resolve the problem by calling a procedure for sending e-mail.

Thanks for the tips !!!
Kelly
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests