"Grant a Role"-Statement in Triggers

From: Ralf <Miko_at_boehrer.de>
Date: 30 Jul 2003 08:25:29 -0700
Message-ID: <fa624200.0307300725.7b4fbe38_at_posting.google.com>


Hi !

When I insert a new record to a table "table_A" I want to Grant a Role "Role_X" to the User "User_Y".

So I made a Trigger who should do this work, but it doesn't:

When I write: "GRANT Role_X TO User_Y" in the Trigger:
--> my Trigger ist invalid (error = ora-04098)
When I declare a varchar-Variable within the trigger, fill it with: "GRANT Role_X TO User_Y" and then : "EXECUTE IMMEDIATE <variable>"
--> my Trigger is valid, but when it fires I get the error:

     ora-04092 - cannot COMMIT in a Trigger

Can anybody help me ?
Is it anyhow possible to GRANT a ROLE after inserting a record ?

Thanks in advance for any help or comments  Ralf Received on Wed Jul 30 2003 - 17:25:29 CEST

Original text of this message