Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2003
    Posts
    5

    Unanswered: Accessing fields from a table, programmatically

    Hi,
    I am working on an application in C#, where I will be displaying the list of all the user tables on the UI and let the user construct the SELECT query. I have got the list of user tables by firing 'SELECT USER_TABLES FROM ALL_TABLES'.
    I now need to display the list of all the fields from the selected table.
    How do I go about this...as in, what should be the query fired for this purpose?
    Thanx,
    -Girish

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    try user_tab_columns

    Alan

  3. #3
    Join Date
    Sep 2003
    Posts
    5
    I'm sorry Alan...
    I didn't quite understand that...
    is it 'SELECT user_tab_columns FROM tablename' ?
    -Girish.

    Originally posted by AlanP
    try user_tab_columns

    Alan

  4. #4
    Join Date
    Feb 2002
    Posts
    28
    Nope Girish.
    select table_name, column_name from user_tab_columns;
    This will list all the tables with the corresponding columns for the user connected.

    PC

  5. #5
    Join Date
    Sep 2003
    Posts
    5
    Thanx PC..
    Tried the same query just before I got your reply..
    -Girish.
    Originally posted by vaidyanathanpc
    Nope Girish.
    select table_name, column_name from user_tab_columns;
    This will list all the tables with the corresponding columns for the user connected.

    PC

  6. #6
    Join Date
    Feb 2002
    Posts
    28
    Right Ho....

  7. #7
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Arrow select

    select utc.col_name, utc.tab_name from user_tab_columns utc, user_tables ut where utc.tab_name=ut.table_name order by utc.tab_name;

    Thanx and Regards
    Aruneesh

Posting Permissions

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