ThatJeffSmith

Oracle SQL Developer: Code on Demand

I’ve recently spent a few hours debugging some user defined reports. A post on how to add trace/disconnect context menus to a session report required that I figure out what session my worksheet was running under.

The code was easy…

select SYS_CONTEXT ('USERENV', 'SID') from DUAL;

…but I’m lazy.

So this:

Type a bit, hit the keyboard, wham-O!

Type a bit, hit the keyboard, wham-O!

The Setup

Open your preferences and go to the SQL Editor Code Templates.

The snippet is 'programmed' into the 'ID', not the 'Template'

The snippet is ‘programmed’ into the ‘ID’, not the ‘Template’

As you code these, you recall them from what you label them via the ID, not the code itself.

And then you activate them in the editor via Ctrl+Spacebar.

Don’t like this keyboard sequence? Change it!.

Not working for you?

Upgrade. I found that a few of mine wouldn’t work, and we found a bug. It’s been fixed in v4. Another reason to go upgrade, like…today.