Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Alert check with MFC

Alert check with MFC

From: Jurgen Roeland <Jurgen.Roeland_at_aisystems.be>
Date: 2 Feb 1999 09:54:06 GMT
Message-ID: <796hvu$2vk$0@195.26.67.210>


Hi all

I'm trying to check if an alert has been set in the oracle 7 database using the dbmsalert package.
My idea was to : - write a stored procedure function that does the alert check and returns a string

Only the last part does not work as it should... even not in SQL*Plus

This is my function :

FUNCTION NTCCLAF_Check_Alert(a in NUMBER) RETURN VARCHAR2 AS

    retmsg varchar2(150);
    status number;
    message varchar2(100);
    alert_name varchar2(30);
 BEGIN
    dbms_alert.waitany(alert_name,message,status,1);     if status=1 then

       retmsg := 'TIMEOUT';
    else

       retmsg := alert_name || '::' || message;     end if;
    RETURN retmsg;
end NTCCLAF_Check_Alert;

My problem is that i can not invoke the NTCCLAF_CheckAlerts function in a select statement.

Oracle returns me :
"select OXY_ALERTS.NTCCLAF_Check_Alert(1) from dual

       *
ERROR at line 1:
ORA-06571: Function NTCCLAF_CHECK_ALERT does not guarantee not to update database"

And yes, its true, he can't, WaitAny will update the alerts table, so you're never able to do this in a select clause. But how do you call the function then in MFC.

Can anyone give me any idea how C++ guys solve this checking if the alert had been set in MFC.

Hopefully waiting for light in the darkness,

Jurgen Roeland
Jurgen.Roeland_at_AISystems.be Received on Tue Feb 02 1999 - 03:54:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US