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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to list all tables for a users?

Status
Not open for further replies.

lhugh

MIS
May 21, 2000
115
CA
I would like to list all the table that belong to John Doe a regular user in my database.

How do I do that in DB2? Thanks
 
lhugh,
Could you define a little better the term 'belong to'? Do you mean those tables that John Doe has created, or do you mean those table that John Doe can access? Or something else?
Marc
 
perhaps you can do a query on SYSIBM tables, for example one on bind-timestamps and libraries.
 
yah, i mean these talbes were created by John Doe

in oracle i would issue this

SELECT table_name
FROM DBA_TABLES
WHERE OWNER='JOHN DOE';
 
lhugh,
Very similar in Oracle to what you do in DB2:
SELECT NAME, CREATOR
FROM SYSIBM.SYSTABLES
WHERE CREATEDBY = 'JOHN DOE'

Hope this helps
Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top