Running Oracle script from Notepad++

80

Solution 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!

Solution 2

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.

Share:
80

Related videos on Youtube

user3381715
Author by

user3381715

Updated on September 18, 2022

Comments

  • user3381715
    user3381715 almost 2 years

    I have successfully changed the SSH port in the /etc/config/uhttpd file using Terminal. But I cannot seem to find a way to do it dynamically from PHP. To explain, I need my server to automatically set the port on the linux system on Yun. So basically I need it to automatically change the port number in the uhttpd file. Thanks in advance.

    • Ruslan Osmanov
      Ruslan Osmanov about 8 years
      What do you mean by changing the port automatically and changing the port dynamically? Do you want a PHP script to change the configuration file remotely? Something like this: ./myscript.php --host=somehost --port=8788?
    • user3381715
      user3381715 about 8 years
      Yes, I need the php script to change the listening port that the linux chip uses from the default 80 to a different port remotely.