Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

fetching oracle table names into java program

 
srinivas k
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Could any one pl: let me know as to how we could fetch the table names from oracle database for a perticular user, a code snippet regarding this is very much appreciated
Thanks
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this. I don't know whether your database will display all tables or just those which are visible to the active user.

[ August 19, 2003: Message edited by: Lasse Koskela ]
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just use the query
select table_name from all_tables where owner='SCOTT';

You can replace the owner by appropriate user name.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
True. That would work if you're not afraid of being slightly locked into Oracle-speficic SQL and if the user has the grant to do a SELECT on ALL_TABLES.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use use user_tables in place of all_tables.
Yes, it is Oracle specific.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic