PS Query & SQL

 View Only
  • 1.  Adding Comments to Expressions

    Posted 01-22-2025 09:43 AM

    1 comment per expression and it has to start and end with the proper syntax (begin with /*+ and end with */ 

    /*+withdraw fee*/ 



    ------------------------------
    Steph Zimmerman
    IT Tech Associate
    Illinois 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!


  • 2.  RE: Adding Comments to Expressions

    Posted 01-22-2025 09:56 AM

    Thanks for this Steph.  I was trying to do this the other day using the "--" as you would use in SQL and of course it didn't work.  PSQuery is very peculiar at times.



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


  • 3.  RE: Adding Comments to Expressions

    Posted 01-23-2025 02:35 PM

    Strictly speaking, a block comment in SQL doesn't include the plus sign, e.g.   

    select something
    /* my block comment */
    from somewhere ;

    The plus sign comes in when passing a "hint" to the DBMS, when you think you have a better way to optimize the query than the automatic optimizer.  That's a whole other topic!  See Oracle's documentation "Influencing the Optimizer with Hints."

    PS Query allows hints but not block comments.  Here's what happens when I try a block comment in an expression, without using the plus sign:

    Fortunately, Oracle database ignores unrecognized hints, thus we can trick PS Query into treating a bad hint like a good comment.

    Welcome to the world of workarounds!  :-D



    ------------------------------
    Ray Martin
    Enterprise Applications Engineer
    Azusa Pacific 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!


  • 4.  RE: Adding Comments to Expressions

    Posted 01-23-2025 04:55 PM

    Haha.  Thanks for that explanation on why it works, Ray.  I am a nerd about the whys of things not just the hows.



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