Trigger that show alert message

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Wed, 09 Apr 2008 4:44 pm

Greetings!!!
Ladies and gentlemen, to grabber to make oracle display an informational message to the user, just informative. I don't want to catch anything ... just alert the user.
I did so ...:--------------------------------------------------------------------------------
Code: 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; 
----------------------------------------------------------------------------------that the way I made ... the message loops ... that's the user clicks ok, and the message back on the screen ...

Anyone have any idea how to solve can I fix this ...?
I thank the attention ....
Celsobtu
celsobtu
Location: Botucatu - SP

Poston Thu, 08 May 2008 10:59 am

Celso, You managed to display informational message?
Had some other alternative?
I am also trying, but you should not abort the addition/alteration of data.

Thank You!
Kelly
kellcristina
Location: São Paulo

Poston Thu, 08 May 2008 11:40 am

the return of the message trigger by raise_application_error this returning to the application that the insert this in error, so he aborts the remaining insercoes ... return messages trigger level and include I desconheco ... I think you need to validate this message the application level ... along with your insert ABCs ...
rodfbar
Location: Batatais - SP

Poston Thu, 08 May 2008 1:04 pm

Or, another hint.
Play the value of this msg in a Log table, let the process continue and in the end, in the application, display a window with this information ...
qualquer thing, says ai.
Trevisolli
Location: Araraquara - SP

Abraço,

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

Poston Thu, 08 May 2008 3:54 pm

Hi all!

As this is a custom application and there was no field available to the message view solved the problem by invoking a procedure for sending email.

Thank you so much for the tips!!!
Kelly
kellcristina
Location: São Paulo



Return to SQL

Who is online

Users browsing this forum: Google [Bot] and 1 guest