Receiving an alert using DBMS_ALERT. : DBMS_ALERT « System Packages « Oracle PL / SQL






Receiving an alert using DBMS_ALERT.

   

set serveroutput on

DECLARE
  v_AlertName VARCHAR2(30) := 'MyAlert';
  v_Message VARCHAR2(100);
  v_Status INTEGER;
BEGIN
  DBMS_ALERT.REGISTER(v_AlertName);
  
  DBMS_ALERT.WAITONE(v_AlertName, v_Message, v_Status);
  
  IF v_Status = 0 THEN
    DBMS_OUTPUT.PUT_LINE('Received: ' || v_Message);
  ELSE
    DBMS_OUTPUT.PUT_LINE('WAITONE timed out');
  END IF;
END;
/


--

   
    
  








Related examples in the same category

1.dbms_alert.signal
2.dbms_alert.waitone
3.Remove your registered interest in a DBMS_ALERT.
4.Sending an alert through DBMS_ALERT.
5.Register interest in an alert.