Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to locate a table

Status
Not open for further replies.

sammybee

Programmer
Sep 24, 2003
103
GB
HI All,

Realise this is a really dumb question, but I want to find a table where table_name like '%BLAH%' how do I do this?

Cheers

Sam
 
select * from dba_tables where table_name like '%BLAH%'
 
Sammy,

Save the following code to a script (such as "TabFinder.sql"), then run the script.

Section 1 -- Contents of "TabFinder.sql" script
Code:
accept tab prompt "Enter part (or all) of a table name to locate: "
SELECT owner, table_name
from all_tables
where table_name like upper('%&tab%')
order by 1,2
/

Section 2 -- Sample invocation of "TabFinder.sql":
Code:
SQL> @tabfinder
Enter part (or all) of a table name to locate: s_emp

OWNER                          TABLE_NAME
------------------------------ ----------
DHUNT                          S_EMP
SUMMIT                         S_EMP
TEST                           S_EMP
TEST                           S_EMP2
WAYYADA                        S_EMP
YADA                           S_EMP
YADA2                          S_EMP
YADA4                          S_EMP

8 rows selected.

Let us know if this is what you wanted.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 17:56 (20Jan05) UTC (aka "GMT" and "Zulu"),
@ 10:56 (20Jan05) Mountain Time

Click here to Donate to Tsunami Relief. 100% of your contributions here go to the victims...0% to administration.
They were "The First-Responder" to the disaster, with relief deliveries arriving before Red Cross and U.S. aid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top