PDA

View Full Version : GEN: Generate DB Trigger from table


Steven C. Kondolf
07-06-2003, 06:42 AM
Hello -

I have a requirement to generate Oracle Appliation table triggers for
a specific schema (i.e. INV) and am wondering if anyone has or knows
of a script that will generate the sql to create the triggers by
reading from the Oracle Tables. Ideally I'd like to supply the schema
and have the script create all the trigger code.

I was able to go in and "cut-n-paste" them from Enterprise Manager but
that was very time consuming especially for a large group of tables.

We're on 8.0.5 of the database (11.0.3 of the apps).

Thanks for any help.
Peace,
Steve
skondolf@garbage.rochester.rr.com

Daniel Morgan
07-06-2003, 08:16 AM
"Steven C. Kondolf" wrote:
Hello - I have a requirement to generate Oracle Appliation table triggers for a specific schema (i.e. INV) and am wondering if anyone has or knows of a script that will generate the sql to create the triggers by reading from the Oracle Tables. Ideally I'd like to supply the schema and have the script create all the trigger code. I was able to go in and "cut-n-paste" them from Enterprise Manager but that was very time consuming especially for a large group of tables. We're on 8.0.5 of the database (11.0.3 of the apps). Thanks for any help. Peace, Steve skondolf@garbage.rochester.rr.com

If the triggers are all identical ... why not just have a simple trigger
that calls a procedure.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan@x.washington.edu
(replace 'x' with a 'u' to reply)

Steven C. Kondolf
07-06-2003, 08:26 AM
Sorry, I wasn't very clear in my original message. I need to extract
the sql for EXISTING triggers on various Oracle Application tables
within a specific schema. For example, I want to recreate the code to
generate all the table triggers for tables owned by INV.

Since writing this I found a script on the internet that will recreate
the sql for one trigger if I supply the schema and trigger name. I
could probably modify the code to generate the sql for ALL triggers
under a particular schema by changing the where clause somewhat.

Thanks for the reply.


On Sun, 06 Jul 2003 09:16:20 -0700, Daniel Morgan
<damorgan@exxesolutions.com> wrote:
"Steven C. Kondolf" wrote: Hello - I have a requirement to generate Oracle Appliation table triggers for a specific schema (i.e. INV) and am wondering if anyone has or knows of a script that will generate the sql to create the triggers by reading from the Oracle Tables. Ideally I'd like to supply the schema and have the script create all the trigger code. I was able to go in and "cut-n-paste" them from Enterprise Manager but that was very time consuming especially for a large group of tables. We're on 8.0.5 of the database (11.0.3 of the apps). Thanks for any help. Peace, Steve skondolf@garbage.rochester.rr.comIf the triggers are all identical ... why not just have a simple triggerthat calls a procedure.

Peace,
Steve
skondolf@garbage.rochester.rr.com

Sybrand Bakker
07-06-2003, 01:34 PM
On Sun, 06 Jul 2003 16:26:35 GMT, Steven C. Kondolf
<skondolf@garbage.rochester.rr.com> wrote:
Sorry, I wasn't very clear in my original message. I need to extractthe sql for EXISTING triggers on various Oracle Application tableswithin a specific schema. For example, I want to recreate the code togenerate all the table triggers for tables owned by INV.


Export followed by import show=y log=<any filename>
will suit your needs perfectly. Other than that you can just dump the
longs in the dba_trigger table can you, or use Toad


Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address

philippe
07-07-2003, 07:46 AM
use a Free tool as "Oracle Tool" found on http://membres.lycos.fr/pmscontact/


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service