ThatJeffSmith ThatJeffSmith
Menu
Search
Stupid Copy & Paste Tricks

The Late Show with David Letterman used to have a bit called, ‘Stupid Pet Tricks.’ I quit watching because I prefer his Scottish and funnier future-replacement, Craig Ferguson. But I will take advantage of some Google-Fu to drive some traffic to ye olde blog (can you tell I’m in the UK this week?)

So most folks GET copy and paste in Windows and Mac. Ctrl or Apple + C for copy, and + V for paste.

In SQL Developer if I do this in a grid, I can get my data out onto the clipboard.

Most folks are OK with this, and here’s what it looks like:

Copying Data Out of a Grid WITHOUT Column Headers

Copying JUST the data with Ctrl+C

Everyone gets this.

What folks need a little help figuring out is how to do the same operation BUT

WITH Column Headers

Throw a SHIFT into your Ctrl+C, get the column headers too!

The magical mystery keystroke sequence is

Ctrl + Shift + C

That’s it.

This works on a single cell or row selection as well.

ENAME
ALLEN

EMPNO	ENAME	JOB	MGR	HIREDATE	SAL	COMM	DEPTNO
7566	JONES	MANAGER	7839	02-APR-81 12.00.00	2975		20

My pug in his natural state.

For what it’s worth, my dog, Bart the pug, only does one trick. He goes crazy if you don’t give him a doggie-treat when leaving or entering the house. What an awesome dog.

arrow18 Responses

  1. arif
    12 mos ago

    SQL Developer strip down 0 if its in front of figure, which caused problem b/w me and one reporter
    eg original value
    emp_id
    0833
    when i export it via sqldeveloper export to cvs/xl or just copy/paste it strip down 0 and give resutl
    833

  2. 12 mos ago

    0833 is a string, If you open Excel and check the formatting of that column, is it set to Number? If so, change it back to a string and I’m guessing the leading 0 will come back.

  3. boris
    11 mos, 3 wks ago

    thanks for your awesome blog, Jeff!

    it is great we can copy data with a header but let me ask you – why do I need to google to find this out? :) would it be more user friendly to see that option on the right mouse click on a data grid? but the good thing i found your blog thanks to that, may be it was your intention?? :)

  4. 11 mos, 3 wks ago

    The goal is to be as intuitive as possible, not to hide things.

    You can use the export feature to send the data to the clipboard in the format you want with column headers.

    Adding a context menu might not be the ideal solution here, but it’s an idea worth considering.

    Thanks for sharing your feedback!

  5. boris
    11 mos, 3 wks ago

    Export/clipboard worked wonderfully – somehow I did not see clipboard option when I looked there.

    P.S. I am new to Oracle and my company uses PL/SQL Developer which I hated from the first time I used it and I am blown away by totally free SQL Developer. I showed it to my boss today and he was very impressed as well. Please keep up the great work!

  6. Diego
    11 mos, 2 wks ago

    I’m really glad to keep following all these amazing tips, all of them have become handy. Even I already conviced some of my colleagues to uninstall “other vendors” IDEs and keep using SQL Developer for everything. Seriously, the Ctrl + Shift + C made my day.

    Keep up this cool website.
    @dresendi

  7. 11 mos, 2 wks ago

    And you comment just made my day! Thanks for sharing Diego!

  8. 11 mos, 2 wks ago

    I agree Diego. I had to have my work laptop reimaged 3 weeks ago due to some OS issues. I took the opportunity to leave Toad in the dust. I am enjoying the innovative features that make my life easier. The screens I miss from Toad were mostly informational and since I already had queries to get a lot of this info I am filling in any gaps with my own User Defined Reports. Also have a long list of things that just make life easier (easy install, lots of config options, quick data modeling).

  9. 11 mos, 2 wks ago

    Any reports in particular you think we should build to help fellow users like yourself make the transition David? You can also look fwd to better reports and more reporting options as SQL Developer updates are made available.

  10. 11 mos, 1 wk ago

    I am slowly converting my jumbled home directory of helpful SQL queries and scripts into UD reports as I come across situations where I need to use them.

    The current incarnation of my UD report collection is available here: https://github.com/dmann99/SQLDevUDRepPack/zipball/master

    I probably need to spend some more time getting familiar with the DBA Navigator so I don’t duplicate any operational functionality. But I am loving the UD reports for my research tasks – click the reports I have set up, get results quickly and nicely formatted so I can drill down and find issues. I usually have OEM open at the same time… When I don’t get the info I need from OEM I jump to my custom queries in SQL Developer.

    I’ll be posting some visualizations I am working on in SQL Developer HTML reports on my blog soon for a table statistics ‘heat map’. I am doing as best I can with PLSQL/DBMS_OUTPUT/HTML – what renders that HTML anyway? Curious about the capabilities…

  11. 11 mos, 1 wk ago

    You can also share reports up on our SQL Developer Exchange

    Here’s an example of a PL/SQL-HTML report I put together for Martin
    http://www.thatjeffsmith.com/archive/2012/04/substitution-variables-html-reports-in-sql-developer/

    We pick up the serveroutput (DBMS_OUTPUT) and render the HTML inside the report. No need to setup HTP.P or anything like that.

  12. 11 mos, 1 wk ago

    Sweet, will check out the exchange and probably package up and contribute if I am worthy heh.

    I found an old HTML report I threw together 3.5 years ago … was wondering more about the capabilities. I haven’t tried any CSS or Javascript inside my HTML reports – is it possible to venture into that territory or should I just stick to Web1.0 style simple tags…

    http://ba6.us/CodeExamples/SQLD-LongOps/SQLD-Longops-ReportRunning.png

    -Dave

  13. 11 mos, 1 wk ago

    Our docs only mention ‘HTML’ so I’m assuming CSS and Javascript are non-starters, today. Tomorrow may bring more exciting possibilities :)

  14. 5 mos ago

    Hi Jeff,

    As always thanks for very informative blog post.
    Just sharing my personal experience using the feature.
    I found that 9 time out of 10 when I make “Ctrl + Shift + C” for one of several columns I am adding them to where cause to limit select further down.

    Just an idea for an enhancement request. Introduce an additional hot key to copy HIGHLIGHTED COLUMN1=’FIRST ROW VALUE’ AND HIGHLIGHTED COLUMN2=’FIRST ROW VALUE’ to clipboard. This will make my life easier.

    Lazy DBA, Yury.

  15. 4 mos, 4 wks ago

    Dude…I love it! Let me see what we can do :)

  16. 4 mos, 4 wks ago

    I like this idea. Can you add it to our exchange on sqldeveloper.oracle.com? Don’t forget to get your friends to vote it up for you :)

  17. 4 mos, 2 wks ago
  18. Bob Thompson
    3 mos ago

    Wow! That is way toooo cool!!!!

Leave A Comment

Notify via Email Only if someone replies to My Comment