Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2005
    Posts
    52

    Unanswered: grant execute on trigger

    Hi,

    I want to grant execute on trigger from once schema to anther. Is there a way to do that.

    thnax

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Not directly (meaning that statement like 'GRANT EXECUTE ON trigger_name TO someone' doesn't exist).

    As the database triggers are associated with tables, granting privilege(s) on the tables automatically grant privileges on the trigger(s). For example:
    Code:
    SQL> create table brisime (id number, name varchar2(10));
    
    Table created.
    
    SQL> create or replace trigger trg_brisime
      2  before insert on brisime
      3  for each row
      4  begin
      5    select nvl(max(id), 0) + 1 into :new.id from brisime;
      6  end;
      7  /
    
    Trigger created.
    
    SQL> grant select, insert on brisime to littlefoot;
    
    Grant succeeded.
    
    SQL> connect littlefoot/bigfoot@ora8
    Connected.
    SQL> insert into scott.brisime (id, name) values (null, 'Littlefoot');
    
    1 row created.
    
    SQL> select * From scott.brisime;
    
            ID NAME
    ---------- ----------
             1 Littlefoot
    
    SQL>
    As you can see, trigger was never granted itself, but the code works properly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •