PS Query & SQL

 View Only

Did you know? -- How to query the SQL behind a view or bind record.

  • 1.  Did you know? -- How to query the SQL behind a view or bind record.

    Posted 01-22-2025 12:02 PM

    I've got some "Did you know" posts coming for things my friends have shown me that I use quite a bit.  I'm hoping at least one person didn't know these.  :)  Sorry, in advance for sending so many posts in a row.

    SQL to query the SQL behind a view or bind record.  Ever wonder why your record isn't getting picked up in a process?  Check the SQL behind the view.

    SELECT A.SQLID, A.SEQNUM, A.SQLTEXT
      FROM PSSQLTEXTDEFN A
      WHERE ( A.EFFDT =
            (SELECT MAX(A_ED.EFFDT) FROM PSSQLTEXTDEFN A_ED
            WHERE A.SQLID = A_ED.SQLID
              AND A.SQLTYPE = A_ED.SQLTYPE
              AND A.MARKET = A_ED.MARKET
              AND A.DBTYPE = A_ED.DBTYPE
              AND A_ED.EFFDT <= SYSDATE)
         AND A.SQLID = :1)
      ORDER BY 2

    Is the SQL coming back and is super long and hard to read?

    Go to this web site to format it:  Instant SQL Formatter & Beautifier Online

    Copy and paste the SQL into that top box.  Change the database to Oracle and click the Formal SQL box.  Your "pretty" SQL will be in the box below.



    ------------------------------
    Dana Pawlowicz
    Business Systems Analyst Sr - ERP
    University of Cincinnati
    ------------------------------

    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!