Running Oracle script from Notepad++

1

1

Can we configure Notepad++ to run an Oracle script? I mean, once we wrote some script (assume a PL/SQL script containing a procedure), can it be compiled from Notepad++ editor itself? If it is possible, what are the steps to do that?

madhu

Posted 2011-12-21T09:41:45.657

Reputation: 1 211

Answers

1

Yes, just install a plugin called NppExec.

Steps:

  1. Open Notepad++
  2. Go to Plugins
  3. Select Plugin Manager
  4. Click on Show plugin manager
  5. Search the plugin called NppExec and install it
  6. Restart the Notepad++
  7. Write a query
  8. Press the key F6
  9. In the box write the next chain to connect:

--The following parameters in strong you will modify--

set ORA_USER=sys
set ORA_PASS=passforsys
set ORA_SID= MYINSTANCE

npp_save
cmd /c copy /y "$(CURRENT_DIRECTORY)\$(FILE_NAME)" "$(SYS.TEMP)\$(FILE_NAME)" >nul 2>&1
cmd /c echo. >> "$(SYS.TEMP)\$(FILE_NAME)"
cmd /c echo exit >> "$(SYS.TEMP)\$(FILE_NAME)"
sqlplus -l $(ORA_USER)/$(ORA_PASS)@$(ORA_SID) as sysdba @"$(SYS.TEMP)\$(FILE_NAME)"

  1. Clik on Save and name it for remember it.
  2. Clik on Ok to run the query
  3. Erase the "as sysdba" if you connect without superuser schema
  4. Enjoy

Regards!

luis torres

Posted 2011-12-21T09:41:45.657

Reputation: 41

3

Yes, you can create a Command in Notepad++, which can run any program, and you can get out the FULL_CURRENT_PATH to the currently open file, which you could send in as a parameter.

So all you'd need is a tool that will connect to an Oracle instance and execute a a file containing your sql script. Maybe you can do that with SQL*Plus, otherwise you can find tools on the net that'll let you do that, just search for something like tool to execute sql script oracle command line. Or it should be quite easy to write a tiny app that takes in a file containing a sql script and connects to the db and executes it.

ho1

Posted 2011-12-21T09:41:45.657

Reputation: 313