Are you missing the feature to record and playback a macro in SQL-Developer?
Well, it’s there, just a bit hidden!
Activate the macro functions
- Select “Tools/Preferences” from the main menu.
- Select “Shortcut Keys” in the list on the left.
- Enter “macro” the right search field.
- Assign “Ctrl+Period” to “Macro Playback”. Period is the “.” key on your keyboard.
- Assign “Ctrl+Shift+Period” to “Macro Toggle Recording”.
Record a macro
To start the recording of the macro, use an editor window of SQL-Developer and press the keys control (ctrl), shift and period (.) together.
The status bar on the bottom shows “Keystroke recording started.”
Any key you will press from now on will be recorded for replay through this macro.
When you are done press the keys control (ctrl), shift and period (.) together again.
The status bar on the bottom shows “Keystroke recording ended.”
There is only one drawback: You can only have one macro at a time. When you record a new macro the previous macro is gone!
Use the macro
Just press the keys control (ctrl) and period (.) together and your macro gets played back.
Example
Adding quotes and commas to a list
Ever wanted the get rid of manually adding quotes and commas to a list of strings?
With a macro it is easy to get from this:
Item 01
Item 02
Item 03
…
Item 99
to this:
‘Item 01′,
‘Item 02′,
‘Item 03′,
…
‘Item 99′,
Here is how:
- Go to the first line of the list.
- Start the recording by pressing the keys control (ctrl), shift and period (.) together.
- Press the following keys (pos1) (‘) (end) (‘) (,) and (“arrow down”) one after each other.
- End the recording by pressing the keys control (ctrl), shift and period (.) together again.
- Play back the macro by pressing the keys control (ctrl) and period (.) together.
- Repeat step 5 until the list is done.

isnt this easier done in excel and then just copy pasted in the sql environ?
Well, I use several tools like Excel, UltraEdit, JEdit and others for certain tasks too. But for some small tasks it’s handier and often faster to just record a manual process as a macro and repeat it. It takes a little practice, but it’s sure worth the time saved.
hi Matthias Schulz,
i need info, connect macro to sql developer for fetching data
is it possible so we need any extra addins to establish connection.
support is worthwile for reducing lot of human efforts in my work
thanks in advance
Hello Mahesh!
The macro function described above is limited to recording keyboard presses.
To fetch data via SQL Developer you need to establish a connection:
Go to menu File/New… and select “Database Connection” in the popup window.
If you want to open an external tool automatically, e.g. SQL*Plus, have a look here:
http://oracledeli.wordpress.com/2011/09/23/sql-developer_execute_via_sqlplus/
Best regards,
Matthias