Solved

Find object owner when more than one have same name

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
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…

737 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