How to search all columns of all tables in a database for a keyword

Discussion in 'Databases' started by abdul gani, Dec 14, 2008.

  1. #1
    Dear Team,

    i have an requirement that : i want to search all the columns of all the tables in the particular database based on the specific key word or an free text.

    example :

    table 1: columns data
    empname sam
    empid 01

    table 2 columns data
    deptname sam
    departmentid 10

    table 3 columns data
    organization name sam
    organization id 1

    when i search for text " SAM"

    it should search me from the entire database, all tables and columns of it and display the result

    output : tablename cloumn value
    table1 empname sam
    table2 deptname sam
    table3 organizationame sam

    the example is just an sample not the real data .

    please help me with sample code or any link related to it .


    thanks in advance
     
    abdul gani, Dec 14, 2008 IP
  2. rajib.bahar

    rajib.bahar Active Member

    Messages:
    87
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    68
    #2
    are you using MS SQL Server 2005 or later versions? If yes, have you considered looking into the sys.tables catalog view...
     
    rajib.bahar, Dec 14, 2008 IP
  3. abdul gani

    abdul gani Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    actually i am using orcale 9i
     
    abdul gani, Dec 15, 2008 IP
  4. rajib.bahar

    rajib.bahar Active Member

    Messages:
    87
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    68
    #4
    sorry I don't use oracle at this time... have you tried looking into meta datas for oracle... SQL server has meta data information that are accessible through views and functions... I would make an educated guess that oracle may have a counter part to that, but, I don't know...
     
    rajib.bahar, Dec 18, 2008 IP