Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2003
    Posts
    87

    Thumbs up Unanswered: query to retrieve 'COLUMN' names in a table

    hi,

    Can anybody tell me how to write a query to retrieve all the column names of a table?

    thanx.

  2. #2
    Join Date
    Nov 2003
    Location
    Rotterdam, Netherlands
    Posts
    127
    select * from user_tab_columns

  3. #3
    Join Date
    Oct 2003
    Posts
    37

    Re: query to retrieve 'COLUMN' names in a table

    Hi

    You could also try

    desc [table_name]

    Regards

    Keith

  4. #4
    Join Date
    Nov 2003
    Posts
    87

    Thumbs up

    thanx.

    i did it with the query

    select column_name from user_tab_columns where table_name ='TABLE_NAME';

  5. #5
    Join Date
    Oct 2003
    Location
    St.Louis,MO
    Posts
    120
    desc table_name is much more useful.
    not only do you get the column names but also what data types the columns accept.

    also shorter to write!

  6. #6
    Join Date
    Dec 2003
    Posts
    74
    ALL THIS INFO CAN BE GOTTEN FROM THE USER_TAB_COLUMNS AND DESC IS NOT A QUERY.

  7. #7
    Join Date
    Nov 2003
    Posts
    87
    Edwin,
    u r exactly right...

    thanx

  8. #8
    Join Date
    Jul 2003
    Posts
    2,296
    as the owner:
    PHP Code:
    select from cols 
    where table_name 
    'ACCOUNT'
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  9. #9
    Join Date
    Nov 2003
    Posts
    87
    We can get it in this way also..


    select cname from col where tname = 'tablename';

  10. #10
    Join Date
    Dec 2003
    Location
    Florida
    Posts
    1
    Hey,

    New to here but, some of the things I've read looks pretty ok. If anyone can help, I need a start orcale script for....

    A online crystal report which requires up to date curreny on a worldly basic.

Posting Permissions

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