NppExec SqlPlus how to check for errors?

134 Views Asked by At

I'm running Notepad++ with NppExec plugin.

When I press F6 i enter a script that connects to my database

set ORA_USER=USER
set ORA_PASS=password
set ORA_SID= DBSID
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 $(ORA_USER)/$(ORA_PASS)@$(ORA_SID) @"$(SYS.TEMP)\$(FILE_NAME)"

If my package doesn't compile, how do I check for errors with "show errors"?

2

There are 2 best solutions below

0
Tom On BEST ANSWER

A workaround at the moment would be to add "show errors;" a the end of the package.

0
Mao73 On

You can add show errors as shown below:

set ORA_USER=USER
set ORA_PASS=password
set ORA_SID= DBSID
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 show errors >> "$(SYS.TEMP)\$(FILE_NAME)"
cmd /c echo exit >> "$(SYS.TEMP)\$(FILE_NAME)"
sqlplus -l $(ORA_USER)/$(ORA_SID)@$(ORA_SID) @"$(SYS.TEMP)\$(FILE_NAME)"

Next you may want to enable error highlighting in console output window: Go to menu Plugins->NppExec->"Console Output Filters" add followng line to detect PLS errors:

%LINE%/%CHAR% *PLS-*
In the field named "Red" enter: FF 

Don't forget to tick the checbox on the left.