How to Copy Only Column Headers from Query Results in Oracle SQL Developer

thatjeffsmith SQL Developer 8 Comments

Tell Others About This Story:

Short and sweet post today – let’s say you’ve written a SELECT *, and your query results have some column headers you want to copy out. Yes, you could copy out the result set WITH the column headers, but maybe you JUST want the column names themselves.

Right mouse on the column headers. not in the grid.

Right mouse on the column headers. not in the grid.

Note you need to select which column headers you want copied by selecting at least once cell in the grid. So in the screenshot above I have ctrl-clicked 3 of the 5 columns by selecting their associated cells. Also, this is a fairly new feature, be sure you’re running v3.2.20_09 of Oracle SQL Developer.

Just another stupid copy and paste trick for your collection 🙂

SQL Developer, The Movie!

Tell Others About This Story:

Comments 8

  1. thatjeffsmith
    DECEMBER 11, 2017 AT 8:24 AM
    just tried this with sqldev 17.3 and office/excel 2016 on Windows 7 and it worked as it should

    Yes thatjeffsmith, for me too… I mean I’ve been using this shortcut since many years (in same laptop i.e. on same version of excel & sql developer), but last week, all on a sudden, it stopped working, hence wondering what could be the issue.

  2. This is really in reply to your previous post on copying data with column headings.

    On Mac OS, you copy with cmd-C and paste with cmd-V.

    However, to copy with column headings is ctrl-shift-C.

    It took me several months to figure that out. Is there anyplace where specific Mac OS keyboard shortcuts are documented?

    1. thatjeffsmith Post

      99% of the time you would find the keyboard shortcuts defined in the preferences. I’m not sure this one is there though as it’s an extended take on the basic clipboard->Copy action when the focus is on a grid object. I’ll startup my Mac mini copy of SQLDev later this morning and see if I can find it.

    2. ctrl-shift-C/V had been working fine in my laptop since ages but suddenly it stopped working today, I mean while I paste it in excel, it’s all getting pasted in a single column. What could be the issue!!

      1. thatjeffsmith Post

        No idea, what is ‘it?’

        And what version of Windows, Office, and SQL Dev are you using?

        The tried and true fix it is generally restart everything – have you tried that?

      2. Restarted everything, didn’t work.
        ctrl+shift+c at sql developer query result copies the output grid (with column name) in clipboard and I used to paste that into microsoft excel by ctrl+shift+v.
        This is, per my knowledge, is the quickest way to export the query output data into excel (grids/cells intact, without any further formatting/ text to columns required). However, now, it’s getting copied in excel like a text i.e. all in a single column. Not sure if it’s an issue with SQL developer settings or microsoft excel settings.

        Windows 7 Enterprise
        Microsoft Office Professional Plus 2013 (for excel)
        Oracle SQL Developer Version

      3. thatjeffsmith Post

Leave a Reply

Your email address will not be published. Required fields are marked *