Writing Code is for Suckers
Yes, I’m joking, mostly. But if you’re in a tool, and it can help you save time, then why not?
Here’s a simple scenario: building a SELECT statement for one or more tables/views.
Dragging and dropping tables to the worksheet is a pretty obvious feature – it copies the object names over for you. But did you know you had the option to get more bang for your buck?
Once you do the drag, you can select what you want copied to the Worksheet. If you don’t see this dialog, open the Preferences and go to the Database – ‘Drag and Drop’ page. Personally I would set it to what I want and toggle OFF the ‘prompt every time.’ I like getting the JOINs written out for me.
For this example I’m only dragging over 2 tables, so the benefit over manual typing is decreased. However, imagine instead I am dragging 15 tables over. Then I think this exercise starts to get exciting.
Just curious, what’s the largest number of TABLES you’ve seen joined in a single statement? 15 seems to be the magic number for smaller audiences. However I’ve ran into a 3 VIEW JOIN that had 50 joined TABLEs each for the 3 underlying VIEWs, so I know there’s some pretty crazy stuff out there.
Tip: Disable Open On Single Click
This default behavior makes it difficult to select and perform operations on more than one object at time.
Ok, back on our ‘trick’ – here is what you get after dragging the tables over.
OK, I don’t want all those COLUMNs, so I toggle over the Query Builder view…
…and toggle off the columns I don’t want. For larger tables, right-click on the TABLE and ‘Uncheck All’, then come back in and toggle the COLUMNs you want. Go back to the Worksheet and…
…voila, our statement is ready!
But Jeff, I HATE(+) Those JOINs!
No worries, in version 18.2, you can toggle that over to ANSI style using the Query builder.
— Oracle SQL Developer (@OracleSQLDev) September 24, 2018