How to Get All the Column Names in an Oracle Database
- 1). Call sqlplus by executing the sqlplus icon on your system. This will depend on your version of Oracle and operating system as it can be run on Windows or Linux. This will display a window with the "SQL>" prompt ready to accept commands.
- 2). Type in the following command to extract all column names from the database:
select column_name from all_tab_cols;
This will list all column names in the database to be saved or viewed. - 3). Filter your search by using a "where" clause to obtain column names by other criteria. The full list of fields in the "All_Tab_Columns" table can be obtained by entering the command:
DESC All_Tab_Columns;
You can then filter your results by one of the other columns in the table. For example to filter by the sales table name use:
select column_name from all_tab_cols where table_name = 'sales';
Source...