PS Query & SQL

 View Only
  • 1.  SQL vs. PSQuery – When Do You Use One Over the Other?

    Posted 02-25-2025 10:29 AM

    PSQuery is great for quick reporting, but sometimes you need full SQL to get the job done. When do you prefer PSQuery, and when do you switch to SQL? Do you use both together? Let's discuss use cases where one shines over the other!



    ------------------------------
    Daniel Labrecque
    Senior 2 Business Systems Analyst/Functional Architect
    University of Nevada, Las Vegas
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------
    Alliance 2026 Registration is Open!


  • 2.  RE: SQL vs. PSQuery – When Do You Use One Over the Other?

    Posted 02-25-2025 10:57 AM

    My preference would be to forego PSQuery altogether, but unfortunately, that is not the world I live in.  SQL brings things like CTEs, inline views, ANSI joins (for everything) that PSQuery cannot emulate.  PSQuery allows you to do population selections via query, which is easier and faster than either creating views or using processes like SQRs or Equation Engine with callable SQL.  PSQuery in combination with BI Publisher can make for some dynamic reporting that brings advantages over straight SQL, but it really depends on your environment and the other reporting tools at your disposal.     

    I do find both useful in scenarios where I'm making a change in Production, but want to try the updated query in one of our test instances.  I can take the SQL from PSQuery and place it in SQL Developer (with some minor adjustments) and try it against one of the test DBs.  It makes the process faster than either having to wait for the change in Prod to rollover to the Test instances the next day or making a change management request. 



    ------------------------------
    Michael Williams
    Systems Analyst
    University of Connecticut
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Registration is Open!


  • 3.  RE: SQL vs. PSQuery – When Do You Use One Over the Other?

    Posted 02-25-2025 11:08 AM

    I agree with oy on all points, Michael.  

    Often times I am able to find a table in Campus Solutions, via inspect element, that is not on my query tree. Now I won't know if that table is worth getting added to my Query Tree. I then go into SQL developer to see if it is worth getting. If I need the table structure for an equation engine callable SQL, I will then just make the SQL there and port it over with the limitations in mind (e.g. CTE does not work in callable SQL due to SQL Parm Miscount).



    ------------------------------
    Daniel Labrecque
    Senior 2 Business Systems Analyst/Functional Architect
    University of Nevada, Las Vegas
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Registration is Open!


  • 4.  RE: SQL vs. PSQuery – When Do You Use One Over the Other?

    Posted 02-25-2025 12:51 PM

    I agree with both Michael and Daniel.  I mainly think of PS Query as creating a public query for staff consumption or operations.   For anything else, I use SQL developer so I am not limited by PS Query structure.  It is a lot quicker to test by commenting out parts of the code and including notes in comments for complicated clauses.  



    ------------------------------
    Ross Nolan
    Data and Reporting Analysis
    University of California, Berkeley
    rvnolan@berkeley.edu
    ------------------------------

    Alliance 2026 Registration is Open!


  • 5.  RE: SQL vs. PSQuery – When Do You Use One Over the Other?

    Posted 02-26-2025 05:35 AM

    I use PS Query as much as possible and use SQL Developer to assist in similar manners described. The reasons I use PS Query:

    • I teach as well as do. Any solution I find can be shared with others using PS Query at my institution
    • PS Queries are the basis for many other things (Publisher, QBUs, Forms)
    • Uses our security model


    ------------------------------
    Robert Fogarty PMP
    Reporting Team Lead | LionPATH Development and Maintenance Office
    The Pennsylvania State University
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Registration is Open!


  • 6.  RE: SQL vs. PSQuery – When Do You Use One Over the Other?

    Posted 02-26-2025 12:53 PM

    From a BSA's perspective, I try to do as much in PS Query as possible, primarily because I want my reports and processes to be sustainable without requiring a programmer's intervention (I can write code, but who knows if my successor will be able to). I admit it does have its sometimes frustrating limits, but it can be a very powerful tool if you know what you're doing and, as Robert mentioned, it is an ideal data source for BI Publisher reports, fluid pivots, e-forms, workflows, security setups, etc. when you don't want every little update to require a work request to IT/IS. 



    ------------------------------
    Krista Lough, PhD PhD
    Business Systems Analyst
    Palomar College
    ------------------------------

    Alliance 2026 Registration is Open!