Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

sql - How can we figure out that a column in my oracle table is being populated/updated by a trigger of another table?

Consider a scenario, where there are two tables "A" and "B".

Table "A" has a trigger "Ta" [written long before me joining this project and thus I'm completely unaware of the trigger], which updates a column named "colB" in table "B".

Now, since I'm mostly using table "B" and concerned about the way "colB" is getting, I won't know if trigger "Ta" is updating this column.

So my question is, is there a direct oracle query/way to find if a column in one table is getting updated by any trigger running on another table?

Thanks in advance for educating me on this.

Regards a.b

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
SELECT *
FROM 
    user_sources
WHERE
    type = 'TRIGGER'
AND UPPER(text) LIKE '%UPDATE A%';

But it won't work if the query is in two lines such as :

UPDATE
    A
SET
   ...

because text matches to a given line in the corresponding object.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...