Running SQRs from Notepad++

by dstock 7. April 2009 18:33

In order to further enhance the functionality of Notepad++ when editing a PeopleSoft SQR, it would be great if it could be run from within notepad++ and display the results or just compile the SQR and see if there are any syntax errors.  This can be accomplished with Notepad++ using the NppExec plugin that comes installed by default.

 

Below are the steps to accomplish this task 

  1. Determine the properly command for running a SQR in your environment.

    Example: C:\psoft\FSDEV\bin\sqr\mss\binw\sqrw.exe MySqr.sqr Database/Username/password  -ZIFC:\psoft\FSDEV\sqr\PSSQR.ini -ic:\psoft\FSDEV\custom\sqr\;c:\psoft\FSDEV\sqr\ -oc:\temp\sqr.log

    It's a good idea to ensure you have this part right first.  Also you can see I included Database/Username/Password.  This format is for MSSQL or DB2.  If you are using Oracle, the format is UserName/Password@Database.    If you exclude this option you will be prompted when the SQR runs.

  2. Modfy the above statement so it will use the current document in Notepad++ by replacing the MySqr.sqr with $(FULL_CURRENT_PATH). (We'll use this statement later)

    Example: C:\psoft\FSDEV\bin\sqr\mss\binw\sqrw.exe "$(FULL_CURRENT_PATH)" Database/Username/password  -ZIFC:\psoft\FSDEV\sqr\PSSQR.ini -ic:\psoft\FSDEV\custom\sqr\;c:\psoft\FSDEV\sqr\ -oc:\temp\sqr.log

  3. Open Notepad++.  Click Plugins->NppExec->Execute  (Or press F6)

  4. In the Command(s): box enter the statement from #2 and on the next line enter  CMD /c type yourlogfilepath  (The path after the -o arguement in the command line.
    Example:

    C:\psoft\FSDEV\bin\sqr\mss\binw\sqrw.exe "$(FULL_CURRENT_PATH)" Database/Username/password  -ZIFC:\psoft\FSDEV\sqr\PSSQR.ini -ic:\psoft\FSDEV\custom\sqr\;c:\psoft\FSDEV\sqr\ -oc:\temp\sqr.log
    CMD /c type c:\temp\sqr.log

  5. Click the Save button, type in Run SQR,  Click Save, then click Cancel

  6. We are going to do the same thing for the syntax checking command but the script will have two differents, an extra -RS paramenter for SQRW and a line to delete the compiled SQR.
    So Click Plugins->NppExec->Execute

  7. Enter a script similar to the following: (I've marked the changes in bold)
    C:\psoft\FSDEV\bin\sqr\mss\binw\sqrw.exe "$(FULL_CURRENT_PATH)" Database/Username/password  -RS -ZIFC:\psoft\FSDEV\sqr\PSSQR.ini -ic:\psoft\FSDEV\custom\sqr\;c:\psoft\FSDEV\sqr\ -oc:\temp\sqr.log
    CMD /c type c:\temp\sqr.log
    cmd /c del "$(CURRENT_DIRECTORY)\$(NAME_PART).sqt"

  8. Click Save, Type in Check SQR Syntax, Click Save, then click Cancel

  9. Click Plugins->NppExec->Advanced Options...

  10. From the Associated Scripts Dropdown list, Choose the Run SQR script and click the Add button. Then choose the Check SQR Syntax script from the Dropdown list and click Add

  11. Ensure the checkbox for "Place to the Macros Submenu" is checked and that [Console] "Visible on Start" is Yes, then click OK


  12. You should get a message you need to restart Notepad++.  Once you close and reopen Notepad++, look under the "Macros" menu and you should see your two new commands.

  13. Now we'll take this one step further and associate these two commands so you can use a key to check the syntax or run the sqr
    Click Settings->Shortcut Mapper

  14. Click the "Plugins commands" button, Scroll down until you see your two new commands, Double click on them and enter the key you want to use for each one.  I used F9, F10. Click Close
    ( Becareful the key you choose and if it is used for another purpose you can get some strange results ) . 

  15. Your done!

If you found this helpful, please check out one of the ads on the page.  Thx!

Currently rated 5.0 by 4 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Open Source | PeopleSoft

Comments

Comments are closed

Powered by BlogEngine.NET 1.4.5.0
Theme by Extensive SEO

About the blog

Focusing on PeopleSoft, SQL, PowerShell, C# and anything else that tweaks my interest