Solved

Find object owner when more than one have same name

Posted on 2003-11-24
2
285 Views
Last Modified: 2006-11-17
(Oracle 9)

Within a trigger, I want to know what schema the trigger lives in.  The thing is I have the same trigger living in several different schemas, all with the same name.  So doing a select off of dba_objects won't get me anywhere b/c the "object_name" column isn't a unique identifier.  I.e.:

SCHEMA1.USR_TRG
SCHEMA2.USR_TRG

-- USR_TRG --
...
schemaName := ?
-- do something with the schema name now

Any ideas on how to uniquely identify the trigger and its owner?
0
Comment
Question by:rwdaigle
2 Comments
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 125 total points
ID: 9813173
can't you query Current_schema
to obtain the current schema id?
0
 

Author Comment

by:rwdaigle
ID: 9813647
Yes, of course I can.  That's what I was looking for.  Specifically: SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA').

Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now