Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 21st, 2004, 01:17 PM
loskinski loskinski is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 loskinski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
view code from triggers

Is there a way that I am able to view the code of the triggers that are currently on my server. Someone else created a trigger for me and I would like to view the code of this. Are their any commands or scripts out there?

Dave

Reply With Quote
  #2  
Old October 21st, 2004, 03:32 PM
jiggee jiggee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 27 jiggee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 27 sec
Reputation Power: 0
Dave,

you could use a free tool like toad or the standard dba studio provided by oracle and easily view the source.

if you do not have access to such tools and you need queries..

user_triggers is the view that will be able to show you the src for a particular trigger. however keep in mind in order to use user_triggers you need to be logged in the schema where the trigger was created...lets say if it was created under the scott schema u need to run the query as scott/tiger. also the field that stores the body of the trigger is a long field so you might need to convert it b4 you can see all of it.

also you can always lookup the tables that create the view in the first place...depends how deep you want to go .

hth,

Jiggee

Reply With Quote
  #3  
Old October 21st, 2004, 04:09 PM
shammat shammat is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,007 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 13 h 57 m 18 sec
Reputation Power: 67
No need to use user_triggers. The view all_triggers should work as well:
Code:
SELECT trigger_name, trigger_body 
FROM all_triggers
WHERE owner = 'the_user_for_which_the_trigger_was_created'
AND table_name = 'the_table'
all_triggers contains the full definition of the trigger as well (row level vs. statement level, before/after etc)

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > view code from triggers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT