Lo and behold, the nice guys at Toadworld already found out how and cared enough to post it years ago. Here are the steps copy-pasted from their article:
That's all there is to it!
- Launch Notepad++
- Main menu → Plugins → Plugin Manager → Show Plugin Manager
- Available Tab, Find and check NppExec plugin (see Figure 3 below)
- Press Install button to download & install plugin – restarts Notepad++
- Open a SQL script
- Press F6 key (NppExec’s default execute keyboard mapping)
- Enter the following macro script into the Execute pop-up (see Figure 4 below)
set ORA_USER=bert
set ORA_PASS=bert1234
set ORA_SID= ORCLnpp_save
cmd /c copy /y "$(CURRENT_DIRECTORY)\$(FILE_NAME)" "$(SYS.TEMP)\$(FILE_NAME)" >nul 2>&1cmd /c echo. >> "$(SYS.TEMP)\$(FILE_NAME)"cmd /c echo exit >> "$(SYS.TEMP)\$(FILE_NAME)"sqlplus -l $(ORA_USER)/$(ORA_PASS)@$(ORA_SID) @"$(SYS.TEMP)\$(FILE_NAME)"
- Change the first three variables for your database, username and password
- Press the OK button
Just replace "bert" with the schema username, "bert1234" is the password and "ORCL" is the SID eg:
Hit enter and see the magic. Don't forget to check the original article. It has a better explanation and also ... pictures!! Yay!set ORA_USER=hr
set ORA_PASS=hr
set ORA_SID=172.19.2.155/XE