Retrieval of the table name [message #1959] |
Wed, 12 June 2002 23:11 |
Dhinakaran
Messages: 3 Registered: March 2002
|
Junior Member |
|
|
Hai
I created a UserName TEST by providing the SQL query
CREATE USER "TEST" PROFILE "DEFAULT" IDENTIFIED BY "test"
DEFAULT
TABLESPACE "USERS" TEMPORARY
TABLESPACE "TEMP" ACCOUNT UNLOCK;
GRANT INSERT ON "SYSTEM"."SYSTEM_TEST" TO "TEST"
GRANT "CONNECT" TO "TEST";";
For this username TEST i provide the privileges to insert data into the Table System_Test of the System UserName.
I am having some tables for Username TEST already in the Database.
If i provide the Query in the SQLPLUS editor like
SELECT TNAME FROM TAB;
i am getting only the Table names available in the Username Test.
Is this possible to display the Table name System_test (User having the privileges to insert the Data) along with table name that Username TEST Owns.
Please help me how to write the Query
Thanks in Advance
Dhinakaran
|
|
|
Re: Retrieval of the table name [message #1960 is a reply to message #1959] |
Thu, 13 June 2002 01:08 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
Hi,
as you can see in catalog.sql script (can be found in ORACLE_HOME/RDBMS**/ADMIN, and creates the system tables/views), The "TAB" view selects only the tables of the current user. Other related queries are:
select table_name from user_tables --> all tables of the current USER.
select table_name, owner from all_tables --> all tables to which the user has acces + the owner of these tables.
User_views, user_objects,....,all_views.... also exist. Perhaps it is interesting to take a look at the system tables/views to see where to find what.
HTH,
MHE
|
|
|