Thanks, Daron! I'm headed to Alliance, but I'll give this a shot and let you know if that query shows up.
Original Message:
Sent: 3/8/2025 1:40:00 PM
From: Daron Wild
Subject: RE: Need help in querying a query
Your original SQL worked for me in SQL Developer, cannot see anything wrong with it. I changed a delivered PSQuery to a Between.
Another variation to add to your list of examples, I've joined on field numbers for the criteria.
SELECT
a.qryname,
a.descr,
b.recname,
b.fieldname,
c.expressiontext
FROM
psqrydefn a,
psqryfield b,
psqryexpr c,
psqrycriteria d
WHERE
b.recname = 'ACCOUNT_SF'
AND b.fieldname = 'ACCOUNT_BALANCE'
AND a.oprid = b.oprid
AND a.qryname = b.qryname
AND b.oprid = c.oprid
AND b.qryname = c.qryname
AND a.oprid = d.oprid
AND a.qryname = d.qryname
AND b.fldnum = d.lcrtfldnum
AND dbms_lob.instr(expressiontext,'200') = 1

------------------------------
Daron Wild
Senior PeopleSoft Developer
University of Cambridge
------------------------------
Message from the HEUG Marketplace:
------------------------------
Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
------------------------------
Original Message:
Sent: 03-07-2025 03:16 PM
From: Dana Pawlowicz
Subject: Need help in querying a query
I will next time. I think we got a good list, and I've decided I'm done looking at it. I need to practice my presentation one more time. π
Original Message:
Sent: 3/7/2025 3:03:00 PM
From: David Ehrlich
Subject: RE: Need help in querying a query
Query has some convoluted-looking ways of storing the field, criteria and expression information. Depending upon how the query builder "did things", the entries in the underlying tables could look quite different than what you might expect.
When you mentioned that you removed the record/field pair and got the query in your result, that leads me to believe something "different" was done in the query and you're in the "convoluted" situation. Therefore, I would suggest the following to help "see" what's going on:
-
In query manager, compare the definition and usage of the field in a query which you did find with your selection to the one which you were not finding. Are they different in some fashion?
-
Dump all the data for both of those queries from the tables PSQRYRECORD, PSQRYFIELD and PSQRYEXPR. (PSQRYCRITERIA and PSQRYBIND can also be useful, although less likely in this situation.) Anything look different?
Perhaps you have done this - I did not notice any reference to these items in this discussion.
Original Message:
Sent: 3/7/2025 1:12:00 PM
From: Dana Pawlowicz
Subject: RE: Need help in querying a query
I ended up taking out the criteria for both ACCOUNT_SF and ACCOUNT_BALANCE and got a bunch of stuff I didn't want but the list wasn't too bad so I just deleted the extra stuff and now I'm getting that query.
Thanks, All!
Original Message:
Sent: 3/7/2025 12:00:00 PM
From: Vic Goldberg
Subject: RE: Need help in querying a query
Last gasp. In my query queries, I never use a trim. I wonder if that could be the issue?
Thanks!
Vic
---
Vic Goldberg
Retiree, Temporary Employee
University of Colorado Boulder
Independent PeopleSoft FA Consultant
Original Message:
Sent: 3/7/2025 11:33:00 AM
From: Dana Pawlowicz
Subject: RE: Need help in querying a query
It's literally driving me crazy. Here is the missing query against the expression table. What is going on? It should be getting picked up and it's not. ARRRRGGGG.
I wouldn't think that field type is the issue, but maybe?

Original Message:
Sent: 3/7/2025 11:26:00 AM
From: Vic Goldberg
Subject: RE: Need help in querying a query
I'm wondering if it is storing the data differently in the query because it is a between using numeric fields. They may not be stored in the expressiontext field, but in one of the other query tables.
Thanks!
Vic
---
Vic Goldberg
Retiree, Temporary Employee
University of Colorado Boulder
Independent PeopleSoft FA Consultant
Original Message:
Sent: 3/7/2025 11:24:00 AM
From: Dana Pawlowicz
Subject: RE: Need help in querying a query
Thanks, I changed it. Still not bring back that one query. So weird!
Original Message:
Sent: 3/7/2025 11:01:00 AM
From: Ross Nolan
Subject: RE: Need help in querying a query
Hi Dana,
When using long text fields in criteria I usually do not use a SUBSTR to make sure I am searching all of the text, see below. Depending on how many queries you are looking through and how your expressions are setup you might want to include the query field Select Number and Field Number in case it is in the experssion text in the fun PS query notation of like :%2.15.
SELECT A.QRYNAME, TO_CHAR(SUBSTR(TRIM( C.EXPRESSIONTEXT),1,2048)), B.SELNUM, B.FLDNUM
FROM PSQRYDEFN A, PSQRYFIELD B, PSQRYEXPR C
WHERE ( A.OPRID = B.OPRID
AND A.QRYNAME = B.QRYNAME
AND A.OPRID = C.OPRID
AND A.QRYNAME = C.QRYNAME
AND B.RECNAME = 'ACCOUNT_SF'
AND B.FIELDNAME = 'ACCOUNT_BALANCE'
AND CASE WHEN C.EXPRESSIONTEXT like '%200%' THEN 'Y' ELSE 'N' END = 'Y')
------------------------------
Ross Nolan
Data and Reporting Analysis
University of California, Berkeley
rvnolan@berkeley.edu
Original Message:
Sent: 03-07-2025 10:30 AM
From: Dana Pawlowicz
Subject: Need help in querying a query
Okay, folks. We are looking for queries that have criteria or having criteria looking for ACCOUNT_SF.ACCOUNT_BALANCE specifically looking for any logic that has 200 in it. They need to change that to 500.
So, I've come close, but I'm missing something. This query has this logic:

And it's not coming back in my query results.
This is my query. Can you guys help me fix it? Please and thank you.
SELECT DISTINCT A.qryname,
dbms_lob.Substr(Trim(expressiontext), 3, 1)
FROM psqrydefn A,
psqryfield B,
psqryexpr C
WHERE ( A.oprid = B.oprid
AND A.qryname = B.qryname
AND B.oprid = C.oprid
AND B.qryname = C.qryname
AND B.recname = 'ACCOUNT_SF'
AND dbms_lob.Substr(Trim(expressiontext), 3, 1) LIKE '%200%'
AND B.recname = 'ACCOUNT_SF'
AND B.fieldname = 'ACCOUNT_BALANCE' )
------------------------------
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.
------------------------------