Search code examples
exceloracleoracle-sqldeveloperexport-to-excel

return column names along with result in oracle select query- to export to excel


I need to get the column names in the result set in oracle select query. When i copy the result set in Oracle SQL Developer to excel only the data gets copied. not column names.

I know i can use dba_tab_columns to get the column information of a table but i want a way to include it in the row format with the result. Also i do not want to hard code the column names with a union query as there are many tables i need to take and lot of columns.

Export option also doesnt work for me as i am connecting to a remote server using Citrix. so it saves to the remote machine path. not the local path


Solution

  • SQL Developer provides a lot of options. And you might be missing something, else the Export option to save the query result as Excel does the job.

    1. Run statement ( Ctrl + Enter)
    2. Right click on the Query Result and select Export

    enter image description here

    1. In the Export Wizard, select excel 2003 +(xlsx) and make sure the check box of Header is ticked.

    enter image description here