Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    37

    Unanswered: Search Table on the basis of value

    Hi All,
    I am stuck with an problem and i want your help. What i want to do is

    I will give a value and i want the tables in which that value is present.

    Example-: Suppose i give a particular value(say abc) so it should display me all the tables where abc is present

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    You need a SP.
    Query DBA_TAB_COLUMNS view to get all the columns that have a char/varchar datatype.
    For each row: SELECT 1 FROM owner_name.table_name WHERE column_name = 'abc' AND ROWNUM = 1
    if found, put the table_name in a temp table and skip to the next table.
    At the end, the temp table will have your list.
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •