Results 1 to 8 of 8

Thread: Extract the table name by using its column name

  1. #1
    Geek_Guest
    Guest

    Extract the table name by using its column name

    How to extract the table name by using its column name?
    Is that possible, if yes, can anyone tell me how

    Question asked by visitor Debasis Das


  2. #2
    Contributing Member
    Join Date
    Apr 2007
    Answers
    46

    Re: Extract the table name by using its column name

    Hi,

    It is not possible to get the table name by taking the reference of a column name.


  3. #3
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    Re: Extract the table name by using its column name

    In oracle it is possible if you have defined any constraint on the column

    Hope you have got me...yeah you can use user_constraints to get the table name...


  4. #4
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Extract the table name by using its column name

    PLEASE USE THIS

    Code:
    select table_name from DBA_TAB_COLUMNS where owner ='OWNER_NAME' and column_name= 'COLUMN_NAME'
    NOTE:--But it will display all the tables having a common / same column name.


  5. #5
    Contributing Member
    Join Date
    Apr 2006
    Answers
    46

    Re: Extract the table name by using its column name

    hi u can use these two tables also in yr schema

    user_tab_columns,user_tab_cols


  6. #6
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Extract the table name by using its column name

    Yes you can also do that.

    But if u select from DBA_TAB_COLUMNS table u can specify of any user schema dynamically.


  7. #7
    Junior Member
    Join Date
    Jan 2008
    Answers
    24

    Re: Extract the table name by using its column name

    just give a name to constraint and try this it will work



    select table_name from user_constraints
    where constraint_name='';


  8. #8

    Re: Extract the table name by using its column name

    select distinct table_name from user_tab_columns where column_name= 'value';


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact