Solved

Find object owner when more than one have same name

Posted on 2003-11-24
2
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
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…

623 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