Triggers?? [message #6807] |
Tue, 06 May 2003 22:41 |
wrbalaji
Messages: 11 Registered: February 2003
|
Junior Member |
|
|
Hello All,
Can any one tell me how to have a single trigger for all tables in my Oracle Database?
To be precise i have 80 tables in a single database user. I want to write a trigger for all 80 tables. Instead of writing 80 triggers for 80 tables i require a trigger which should keep track of all table manipulations.
Can anyone help me in this regard?
thanks in advance..
balaji.
|
|
|
Re: Triggers?? [message #6811 is a reply to message #6807] |
Wed, 07 May 2003 00:30 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
If by "manipulations", you mean DML, you will need 80 triggers. But...you can use the data dictionary to automate the writing of the triggers for you. If you can give us an idea of what the triggers should do, we can provide an example or link on how to do this. Barbara has some very good examples that she has posted in the past.
|
|
|
Re: Triggers?? [message #6815 is a reply to message #6811] |
Wed, 07 May 2003 01:26 |
wrbalaji
Messages: 11 Registered: February 2003
|
Junior Member |
|
|
Hi TODD BARRY,
Thank you very much for your initiative in providing the support.
Apologize me if you can't able get the exact meaning from my question? Let me describe in more detail.
My requirement is the application should be able to monitor which user has modified a table. I mean a user may insert,delete or update a table. As i said there are totally 80 tables in the database. My application should know which table has been modified and by who. The user name and modified date details i have with all tables. So if the administrator requires to monitor 30 tables out of 80 i should know who are all persons and at what time they have modified that selected 30 tables. For that without creating a trigger for each table i need to create a trigger for all selected tables.
hope the above is clear.
thanks in advance..
balaji.
|
|
|
Re: Triggers?? [message #6817 is a reply to message #6815] |
Wed, 07 May 2003 02:43 |
|
Barbara Boehmer
Messages: 9090 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
Tom Kyte has the best example of how to dynamically create triggers. Please click on the link below for an automated method of creating a trigger for each of your tables. You can use an in list to limit the tables that you want to create triggers for.
|
|
|