Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Oracle SQL Devleoper, when I copy the results, how can I copy the column headings too?

In Oracle SQL Devleoper, when I copy the results, how can I copy the column headings too?

For example, I don't want:

doucette matthew xona.com etc. 

I want:

lastname firstname url      etc. -------- --------- -------- ---- doucette matthew   xona.com etc. 
like image 973
Xonatron Avatar asked Nov 03 '11 16:11

Xonatron


People also ask

How do I copy column headers?

You can copy the column headers by selecting the columns in the columns list on the left, and then copying with Edit > Copy As Text (not Edit > Copy). Then, select the first row and then Edit > Paste.

How do I copy all headers in SQL?

Select cells from the columns you want to copy (CTRL+Click), choose "Copy selected Headers" in Results grid context menu and column names will be copied to clipboard. This action creates a comma-separated list that can be pasted wherever you need.

How do I copy a column in SQL Developer?

Today's Quick Tip: Want to just copy column headers from a query or table? Right-mouse on the column headers (not the grid itself) and select 'Copy Selected Column Header(s). If you want to copy rows WITH column headers to the clipboard, use Ctrl+Shift+C instead of Ctrl+C.

How do I get the column names in SQL Developer?

To select column names of a given table you can use the following query: Select column_name from user_tab_cols where table_name =3D'TABLE_NAME'; Remember the table name should be in capital letters.


2 Answers

I found the answer on https://forums.oracle.com/forums/thread.jspa?threadID=2162606. Once you have selected the results (Ctrl +A) then use Ctrl + Shift + C to copy, this will copy the headers aswell.

Regards

like image 186
Marius Botha Avatar answered Sep 17 '22 19:09

Marius Botha


In SQL Developer 3.0.04, once you have run your query, right click on the results grid and select export....

enter image description here

Complete the dialogue box as follows.....

enter image description here

Select next, then finish and then paste into the destination program

like image 20
Ian Carpenter Avatar answered Sep 16 '22 19:09

Ian Carpenter