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

Home -> Community -> Usenet -> c.d.o.server -> Re: grant in trigger

Re: grant in trigger

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 27 Jun 2007 08:31:05 -0700
Message-ID: <1182958265.122075@bubbleator.drizzle.com>


peter 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

What is the business case for writing this abomination?

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Wed Jun 27 2007 - 10:31:05 CDT

Original text of this message

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