Solved

Find object owner when more than one have same name

Posted on 2003-11-24
2
284 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MYSQL Record Number 3 55
SQL Insert Query Help 16 87
Data quality checks 2 34
Need Distinct Value from Joined Tables in MSSQL 5 31
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
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…

747 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

13 Experts available now in Live!

Get 1:1 Help Now