SQL Query using user_tab_columns and user_col_comments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deeps3012
    New Member
    • Sep 2007
    • 1

    #1

    SQL Query using user_tab_columns and user_col_comments

    Hi,
    I am using user_tab_column s and user_col_commen ts to get details about the table.

    Here is my code:
    select * from user_tab_column s where table_name='sam ple_table';

    After running this query in TOAD/Oracle SQL plus, i get "no rows selected".

    Sample table:

    NAME AGE CUST_ID
    ---------- ---------- ----------
    deepali 22 68162
    hrishikesh 23 69876
    prashant 25 78162

    Please help me out.

    Thanks,
    Deepali
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by deeps3012
    Hi,
    I am using user_tab_column s and user_col_commen ts to get details about the table.

    Here is my code:
    select * from user_tab_column s where table_name='sam ple_table';

    After running this query in TOAD/Oracle SQL plus, i get "no rows selected".

    Sample table:

    NAME AGE CUST_ID
    ---------- ---------- ----------
    deepali 22 68162
    hrishikesh 23 69876
    prashant 25 78162

    Please help me out.

    Thanks,
    Deepali
    Hi Deepali,

    Try using below Query:
    [code=oracle]
    SELECT * from all_tab_columns WHERE UPPER(table_nam e) = 'SAMPLE_TABLE';
    [/code]

    Comment

    • OracleStudent
      New Member
      • Mar 2012
      • 1

      #3
      Try putting 'sample_table' in upper case, like this:

      select *
      from user_tab_column s
      where table_name='SAM PLE_TABLE';

      Comment

      Working...