Which

Resolves an object name following the same resolution path as SQL or PL/SQL:
e.g. given the name "EMP", figure out that it's a public synonym for SCOTT.EMPLOYEES.

Usage - use any of the following:
@which emp
@which scott.emp
@which em%

The report is in two parts. First it queries DBA_OBJECTS (or if that is not accessible it will automaticallly switch to ALL_OBJECTS) for any matching objects. The results include whether there is a synonym and whether you have been granted access. Then it calls DBMS_UTILITY.NAME_RESOLVE, which prior to 9i resolved the names of stored code (packages, procedures etc) but in recent versions has been extended to other database objects such as tables.

If you use a wildcard, the report will stop after querying DBA_OBJECTS.

It is possible for an object to appear in the first part of the results because it was found in DBA_OBJECTS, but not actually be resolvable, for example because it resides in another schema and you are missing a synonym.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Index of code examples

Subscribe to newsfeed (Atom format)

This page is powered by Blogger. Isn't yours?