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 -> Re: alert package

Re: alert package

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 04 Sep 1998 13:32:38 GMT
Message-ID: <3618eb96.175112678@192.86.155.100>


A copy of this was sent to Silvio Esser <esser_at_c-s-k.de> (if that email address didn't require changing) On Fri, 04 Sep 1998 15:26:21 +0200, you wrote:

>Hi everybody,
>
>I'm a newbie in using Oracle. In my code I create a trigger
>on a table, which should send a signal after editing
>the table:
>
>..
>create or replace trigger audit_client
>after update or insert or delete on client
>BEGIN
> dbms_alert.signal ('client_alert', 'client_message');
>END ;
>/
>
>Now, if I compile this code I get an error messsage
>saying:
>
>..
>Warning: Trigger created with compilation errors
>

SQL> show errors trigger audit_client

will show you the error. I'll betcha the error is "dbms_alert" is undefined (not found) when compiling. This is because roles are never enabled during the execution of a stored object (trigger, procedure, view, etc).

Try this:

SQL> set role none;
SQL> "statement you want to test to see if it'll work in a procedure"

If you can do it in plus with no roles you can do it in a procedure. If you can't, you must have the privelege from a role and hence won't be able to do it in a procedure.

You probably have the privelege to do what you are trying to do in the procedure via a role. Grant the privelege directly to the owner of the procedure and it'll work.

grant execute on dbms_alert to <TRIGGER_OWNER>;

>But I can't find where the problem. Desperatley, I used the output
>package with dbms_output.put_line instead of the dbms_alert.signal
>(leaving the other code untouched) and it worked. So I concluded that
>the problem should be in the alert package.
>
>Does anybody have an idea how to get it compiled properly?
>Thanks.
>Silvio
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Fri Sep 04 1998 - 08:32:38 CDT

Original text of this message

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