Home >> FAQs/Tutorials >> Oracle Tutorials

Oracle Tutorials - Show All Columns in an Existing Table

By: FYIcenter.com

(Continued from previous topic...)

How To View All Columns in an Existing Table?

If you have an existing table and want to know how many columns are in the table and how they are defined, you can use the system view USER_TAB_COLUMNS as shown in the following tutorial exercise:

SQL> COL data_type FORMAT A12;
SQL> SELECT column_name, data_type, data_length 
  FROM user_tab_columns WHERE table_name = 'EMPLOYEES';
COLUMN_NAME                    DATA_TYPE    DATA_LENGTH
------------------------------ ------------ -----------
EMPLOYEE_ID                    NUMBER                22
FIRST_NAME                     VARCHAR2              20
LAST_NAME                      VARCHAR2              25
EMAIL                          VARCHAR2              25
PHONE_NUMBER                   VARCHAR2              20
HIRE_DATE                      DATE                   7
JOB_ID                         VARCHAR2              10
SALARY                         NUMBER                22
COMMISSION_PCT                 NUMBER                22
MANAGER_ID                     NUMBER                22
DEPARTMENT_ID                  NUMBER                22

(Continued on next topic...)

  1. What Is a Database Table?
  2. How Many Types of Tables Supported by Oracle?
  3. How To Create a New Table in Your Schema?
  4. How To Create a New Table by Selecting Rows from Another Table?
  5. How To Rename an Existing Table?
  6. How To Drop an Existing Table?
  7. How To Add a New Column to an Existing Table?
  8. How To Add a New Column to an Existing Table with a Default Value?
  9. How To Rename a Column in an Existing Table?
  10. How To Delete a Column in an Existing Table?
  11. How To View All Columns in an Existing Table?
  12. How To Recover a Dropped Table?
  13. What Is Recycle Bin?
  14. How To Turn On or Off Recycle Bin for the Instance?
  15. How To View the Dropped Tables in Your Recycle Bin?
  16. How To Empty Your Recycle Bin?
  17. How To Turn On or Off Recycle Bin for the Session?
  18. How To List All Tables in Your Schema?

Oracle Tutorials:

More...


Other Tutorials/FAQs:

More...


Related Resources:

More...


Selected Jobs:

More...