Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    14

    Unanswered: SQL for getting datatypes from a table

    Is there, in Oracle 9i, a means for extracting the datatypes from a table for each column? I'd be doing this from Coldfusion.

    Thanks!

    Nancy

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    SQL> DESC ALL_TAB_COLUMNS
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2002
    Posts
    833
    select owner, table_name, column_name, column_type from dba_tab_columns;

    descr dba_tab_columns ; -- for all attributes

  4. #4
    Join Date
    Mar 2004
    Posts
    14
    I'll probably need a bit of hand holding for things that'd be obvious to everyone else.

    select owner, table_name, column_name, column_type from dba_tab_columns;

    9:43:17 ORA-00942: table or view does not exist

    Is dba_tab_columns possibly called something else in my database? Any idea how to find it? Sorry to be such a DB thicky.

  5. #5
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    You may have to get the DBA to grant you privs to these SYS views.

    Gregg

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Or, if you need description of your own tables / columns, try
    PHP Code:
    SELECT table_namecolumn_namedata_type 
      FROM user_tab_columns

    Also, try to describe user_tables along with user_tab_columns to be able to write a query that will join those two views.

  7. #7
    Join Date
    Mar 2004
    Posts
    14
    Horray! That's percisely what I needed Littlefoot!

Posting Permissions

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