Results 1 to 5 of 5

Thread: Query for columns in oracle database

  1. #1
    Join Date
    Jan 2010
    Posts
    52

    Query for columns in oracle database

    Hi,
    Can you tell me something about the query on the columns of the tables. I have queried so much on the tables but I need to query on the particular columns of the table. Can you tell how can I do that.Is there any advance procedures to complete this task.Please let me introduce about it.

    Thanks

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Query for columns in oracle database

    Query for columns in oracle database :

    You can query not only on tables or any other objects of database.you can query on the columns of the particular table in database.There are some defined data dictionary tables for this task.The tables are as follows :

    1- USER_TAB_COLUMNS
    2- DBA_TAB_COLUMNS
    3- ALL_TAB_COLUMNS

    These are three most required data dictionary tables which is being used to get information about the columns of particular tables.

  3. #3
    Join Date
    May 2008
    Posts
    4,085

    USER_TAB_COLUMNS for columns information

    USER_TAB_COLUMNS :

    The USER_TAB_COLUMNS data dictionary provided by database management system which is used to view the user level columns and related tables with their respective data types.

    Before executing this query,you can see the structure of this particular table using DESC command.

    Code:
    SQL> SELECT table_name, column_name, data_type, data_length
      2  FROM USER_TAB_COLUMNS
      3  WHERE table_name = 'TABLE_NAME'
      4  ORDER BY column_id;

  4. #4
    Join Date
    Apr 2008
    Posts
    3,267

    DBA_TAB_COLUMNS for columns investigation

    DBA_TAB_COLUMNS :

    The DBA_TAB_COLUMNS data dictionary view is used to see the columns condition of those tables which is owned by DBA(Database Administrator),meas all the tables of database can be configured by DBA.

    The Normal user can't perform this view because it is granted to only DBA by the database.The DBA_TAB_COLUMNS view contains same columns which is used by USER_TAB_COLUMNS but the accessing method is different from each other.

    Describes the columns of all tables, views, and clusters using DESC command in the database.

  5. #5
    Join Date
    Apr 2008
    Posts
    3,522

    ALL_TAB_COLUMNS to Query for columns

    ALL_TAB_COLUMNS data:

    This view provide same information which is generated by ALL_TAB_COLUMNS but the use and implementations are different.

    To collect the statistics for this view, use the SQL ANALYZE statement or the DBMS_STATS package.it provides the information of all the table columns which is owned by every users.

    NOTE: DBA_TAB_COLUMNS describes the columns of all tables, views, and clusters in the database,USER_TAB_COLUMNS describes the columns of all tables, views, and clusters owned by the current user. This view does not display the OWNER column.

Similar Threads

  1. Query in SQL v/s Query in Oracle
    By Satchel in forum Software Development
    Replies: 4
    Last Post: 29-12-2010, 07:19 AM
  2. Statpack in oracle database
    By Reegan in forum Networking & Security
    Replies: 5
    Last Post: 16-02-2010, 08:00 PM
  3. How to deal with oracle character query in Wildcard
    By Shanbaag in forum Software Development
    Replies: 3
    Last Post: 11-08-2009, 10:23 AM
  4. MySQL query select all columns but exclude specific.
    By RSeven in forum Software Development
    Replies: 3
    Last Post: 29-07-2009, 09:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,716,539,919.29869 seconds with 16 queries