• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to search all the tables of a database for a data item?

 
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I want to search all the tables in a database for a data entry say 12232332. By that, I mean I want to know the names of all the tables which have 12232332 in any of their rows. I am using DB Visualizer 4.3.2 and right now for all the tables. I don't have select or any other rights . How do I go about achieving this? I guess I cannot do anything without the rights. Or can I? In case I get the rights how can I achieve this?

Thanks.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Arjun,
Yes - you need the DBA to grant you select access to the tables.

The only way I can think of to query all tables, is to write a stored procedure.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:Arjun,
Yes - you need the DBA to grant you select access to the tables.

The only way I can think of to query all tables, is to write a stored procedure.



Thanks Jeanne for replying. I will try to get the rights tomorrow. Can you tell me the stored procedure to do this?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:The only way I can think of to query all tables, is to write a stored procedure.


For a solution w/o stored procs one could use the DatabaseMetaData class to find out the names of all tables, then query those individually, and combine the results in the client code.
reply
    Bookmark Topic Watch Topic
  • New Topic