check if column is created by trigger

hi

i want to know if the prod_id column in my Product table is being generated by a trigger.

I am using this sql but no luck. Any clue what i am doing wrong?



SELECT * FROM all_dependencies WHERE  referenced_name = 'PRODUCT.PROD_ID' AND type IN ('PACKAGE BODY', 'PROCEDURE', 'FUNCTION', 'TYPE','TRIGGERS');
royjaydAsked:
Who is Participating?
 
slightwv (䄆 Netminder)Connect With a Mentor Commented:
I don't think you can get the 'column' but you can at least find the trigger then look at the trigger code:

SELECT * FROM all_dependencies WHERE  referenced_name = 'PRODUCT' AND type IN ('TRIGGER');
0
 
Mark GeerlingsConnect With a Mentor Database AdministratorCommented:
The all_dependencies view in Oracle does not track dependencies down to the column level, just to the table level.  So, you need to use a query more like what slightwv suggested, then review the PL\SQL code for the objects that query returns to see if they include references to the column you are interested in.
0
 
royjaydAuthor Commented:
>>SELECT * FROM all_dependencies WHERE  referenced_name = 'PRODUCT' AND type IN ('TRIGGER');


ok.

I assume i can use the same query
SELECT * FROM all_dependencies WHERE  referenced_name = 'PRODUCT' AND type IN ('PACKAGE BODY', 'PROCEDURE', 'FUNCTION', 'TYPE','TRIGGERS');

which will give me references in triggers and other places.
0
 
slightwv (䄆 Netminder) Commented:
There is no 'TRIGGERS', change it to 'TRIGGER'.
0
 
MikeOM_DBACommented:
Perhaps instead of looking at the actual trigger code, just query: DBA_TRIGGER_COLS...
:p
0
All Courses

From novice to tech pro — start learning today.