Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: grant in trigger
On 27 jun, 10:58, peter <hhh.datab..._at_gmail.com> wrote:
> how to give execute grant command in trigger as execute immediate is
> not working in it.
>
> SQL>CREATE OR REPLACE TRIGGER Try
> 2 AFTER CREATE
> 3 ON database
> 4 BEGIN
> 5 execute immediate 'grant select on scott.chk to hr';
> 6 end;
> 7 /
>
> Trigger created.
>
> Elapsed: 00:00:00.00
> SQL>create table scott.b(b number);
> create table scott.b(b number)
> *
> ERROR at line 1:
> ORA-00604: error occurred at recursive SQL level 1
> ORA-30511: invalid DDL operation in system triggers
> ORA-06512: at line 2
Which is the part that you don't undestand in "invalid DDL operation in system triggers"?
Read the (F) documentation:
"Cause: An attempt was made to perform an invalid DDL operation in a
system
trigger. Most DDL operations currently are not supported in system
triggers.
The only currently supported DDL operations are table operations and
ALTER?COMPILE operations."
Cheers.
Carlos. Received on Wed Jun 27 2007 - 04:51:41 CDT