Query Manager Tips and Tricks
Query Manager Tips and Tricks
1 - Introduction
What can we use PeopleSoft Query for?
• Explore and understand data
• Ad hoc reporting from Query Manager
• Scheduled Query based reporting
• Population selection
• Used as Data Sources for:
• Communications
• BI Reports
• Pivot Grids
List of PeopleSoft Tables
HRMS: http://hrmspeoplesoft.blogspot.com/p/peopletools-tables.html
CS: http://peoplesoft.wikidot.com/campus-solutions-tables
FSCM: http://finance.fiu.edu/controller/Docs/Commonly_Used_Tables.pdf
ELM: https://peoplesofttutorial.com/complete-list-of-peoplesoft-elm-9-1-tables/
PeopleBooks: http://docs.oracle.com/cd/E29376_01/hrcs90r5/eng/psbooks/index.htm
https://mypeoplesoftwebpage.com/psp/hcmdev/EMPLOYEE/
HRMS/c/QUERY_MANAGER.
QUERY_MANAGER.GBL
Component Navigation
SELECT DISTINCT
REVERSE(LTRIM(SYS_CONNECT_BY_PATH
(REVERSE(PORTAL_LABEL),' >- '),' >- '))
"NAVIGATION"
FROM PSPRSMDEFN P
WHERE PORTAL_OBJNAME = 'PORTAL_ROOT_OBJECT'
-- Add your Component Name Here
START WITH PORTAL_URI_SEG2 =
'QUERY_MANAGER'
CONNECT BY PRIOR PORTAL_PRNTOBJNAME =
PORTAL_OBJNAME
AND PORTAL_NAME = PRIOR PORTAL_NAME;
Component Navigation
Root > Enterprise Components > Find Object Navigation
PeopleSoft – Components Vs Pages
Records in a component
-- List of Records under a component
SELECT DISTINCT (recname) FROM psrecdefn
WHERE recname IN (SELECT DISTINCT (recname) FROM pspnlfield WHERE pnlname IN
(SELECT DISTINCT (b.pnlname) FROM pspnlgroup a, pspnlfield b
WHERE (a.pnlname = b.pnlname OR a.pnlname =b.subpnlname)
AND a.pnlgrpname = 'Component Name’ -- specify your component name)
AND recname <> ' ‘)
UNION
SELECT DISTINCT (recname) FROM pspnlfield
WHERE pnlname IN (SELECT DISTINCT (b.subpnlname) FROM pspnlgroup a,pspnlfield b
WHERE (a.pnlname = b.pnlname OR a.pnlname = b.subpnlname )
AND a.pnlgrpname = 'Component Name') -- specify your component name)
AND recname <> ' ')
AND rectype = '0' -- specify record type
order by recname asc;
Records and fields on a Page
-- List of Records and Fields used on a Page
SELECT recname, fieldname
FROM pspnlfield
WHERE pnlname = 'PageName';
2 – PS Query tab-by-
tab
Root -> Reporting Tools -> Query -> Query Manager
Records Tab
• Use the Search feature to find your records
(tables)
• Bring in tables one at a time. Know your
criteria, and then join
• Always go with the most basic tables you
can find
• We suggest avoiding views – Unless you
know what are in them
Records Tab
• Click on Show fields to get to
this page – examine what is in it
• Click on Add record to create a
query with that record.
• Search and add more to create
joins
• Keys are marked with a Y in
front – Example has a composite
key with 6 fields
Query Tab
• You can define criteria here
using the filter icon, or on the
criteria page
• Add fields to your query by
selecting the checkboxes.
Don’t be too eager to select
too many fields at first, add
them gradually to see how
they will impact your query
• Always check to make sure
your table makes sense
before joining it in
Query Feeds
• The Feed Publishing Framework
provides user interfaces and
application programming interfaces
(APIs) for RSS feed definition creation
and maintenance, feed searching and
subscription, as well as feed document
generation and delivery.
• Two levels of security:
• Feed security
• Data security
• Use the Fields page to publish a query
as a feed
Expressions Tab
• A means of defining your SQL
statement – usually used in
Select & Where statements
• For now, we will only define
expressions on the criteria
page
• Anything that can be used in
an Oracle database can be
used in an expression
• The internet is a great
resource to find expressions
Prompts Tab
• Prompts are also known as bind variables
• Prompts are completely user configurable – you can decide the length, the format,
the edit type*, and specify a default value
Prompts Tab
Fields Tab
• You can use the field tab to
define the display
information for your fields.
Based on the tables you
choose, these will be defined
for you – however (as with
everything else) they are
configurable
• You can re-order and sort
here as well
Fields Tab
• You can also change the field header and name
• Keep an eye out for translate values that can display several
different sets of values based on your choice
Criteria Tab
• Add, edit, or group criteria
• Edit auto join criteria
Criteria Tab
Choose your Operand (and, or, >, <, >=, <=, between, in list, like, equal to,
not equal to, not in list, not like)
Criteria Cont’d – Sub
Query
Joining tables
Inner Join (Standard Join) Full Outer Join Left Outer Join
Left Outer Join (Exclude B with Where) Full Outer Join (Exclude B with Where)
Standard Join
• You can do standard joins to as
many tables as you want
• PS Query will suggest Auto Join
Criteria based on field name
Left Outer Join
• To outer join, change each of
your join criteria to
[fieldname]
• Adds as a ‘belongs to’
Left Outer Join
• When adding criteria for
Left Outer Joins, make
sure you set the criteria as
ON clause of outer join
• Otherwise, the criteria will
cause your join to act as a
standard join
Having Tab
• Only used with aggregate field functions
• If you have an aggregate field that you
want to use in criteria, it must be in a
having criteria
Dependency Tab
• Related to Composite Query
• Checking Security Join Optimizer can help optimize some queries by using the
same query security record for the first join and then all subsequent joins, rather
than using a different security record for each join
• Can be very useful if you have a slow running query with many joins
• Not recommended for left outer joins
Query Properties
Some Tips for Using Query Manager
• TO_DATE('2003/07/09', 'yyyy/mm/dd’) -
• TO_DATE('2015/05/15 8:30:25', 'YYYY/MM/DD HH:MI:SS')
• Result: 09-JUL-03
DECODE(A.Day,
‘M’, ‘Monday’,
‘Tu’, ‘Tuesday’,
‘W’, ‘Wednesday’,
‘Th’, ‘Thursday’,
‘F’, ‘Friday’,
‘Holiday’)
Expressions – Setting up Criteria in Bulk!
• Need to setup criteria with 100
– 1000 EMPLIDs in the Where
clause
• Data is provided in an Excel
Spreadsheet or from a SQL
Developer Query
• How do we transition that into
Query Manager Criteria?
• Excel and SQL Developer Demo
Expressions – Setting up Criteria in Bulk!
Expressions - Meta-SQL
https://blogs.bgsu.edu/geeks/2015/10/09/query-get-clobed/
Drilling URLs
• Drilling URLs are used when you’d like to provide a functioning URL as a
column in your query.
• They are another type of expression.
Drilling URLs
To create a drilling URL in your query, add an expression, with an expression type of
Drilling URL, and select your URL type:
Drilling URLS
To link to a component in PeopleSoft, choose component URL, and
fill out the component information that you’d like to link to, and the
action (update, etc). (you can use Cntrl +J to find component and
page info)
Drilling URLS
URL search keys pre-populate the
search area where you would
typically enter data, with the data
from your query
On Admin Tab
Query Administration
On Executing Tab
Query Administration
https://support.oracle.com/epmos/faces/DocumentDisplay?id=1395740.2
Setting Trace for PS Query
Set the trace right before the affected query is run.
• Navigate to PS_CFG_HOME\appserv\<Database Name> and open the psappsrv.cfg file.
• Locate the TraceSql= value and set it to 31.
• Save the file.
• Note: If Allow Dynamic Changes=Y, then there is no need to restart the Application Server. If
Allow Dynamic Changes=N, then the Application Server will need to be restarted.
• Navigate to Query Manager or Viewer and submit the affected query to run.
• Once complete, return to the Application Server config file and set the TraceSql= value to 0.
• Retrieve the *.tracesql file in the <ps_cfg_home>/appserv/<domain>/LOGS/ directory.
https://support.oracle.com/epmos/faces/DocumentDisplay?id=2209232.1
5 – Lessons learned from
PeopleSoft Upgrades
Issues After Upgrades
E-QR: Downloading / Running PS Queries To Excel Adds A Time Component To The
Date Field (Doc ID 2140351.1)
E-QR: After Upgrading To 8.55.19, Excel Query Output Displays Dates As 1/0/1900
(Doc ID 2354528.1)
Solutions:
• Upgrade to PeopleTools 8.56.02
• Set Timezones for DST to correct query excel output
• Create an Expression that treats this output field as a CHAR(10)
• INSERT INTO PSVERSION (OBJECTTYPENAME, VERSION) VALUES ('QRYBIFF',1)
Issues After Upgrades
Solutions:
• Upgrade to PeopleTools 8.54.22
• Code Fix in QRY_VIEWER_WRK.HTML_FUNCS PeopleCode
• &bDisableExcelXML = False;
• Post 8.55 Upgrade – Clear Cache at Browser and App Server Level
Issues After Upgrades
Solutions:
• View the field display on the query and make sure the translate
value effective date setting is correct. Usually Current Date is
the correct setting, others are more advanced, and need to
make sense with the query.
Issues After Upgrades
E-QR: When Deleting A Public And A Private Query Together, User Kicked Out Of PIA (Doc ID 2368845.1)
E-QR: PS Query Giving "ORA-00979: Not A GROUP BY Expression" Error When Using Aggregate Function and (+)
Join Operator(Doc ID 2118085.1)
E-QR: PS Query With Group Criteria Throws The Error "Illegal usage of parenthesis in criteria!" After PeopleTools
8.55 Upgrade (Doc ID 2278442.1)
E-QR: Composite Query Fails With ORA-01427 When Standard Pruning Is Selected. (Doc ID 2368846.1) – Solved in
8.55.24
E-QR: Performance Issues With Date Fields in Query Excel Output With PeopleTools 8.55 (Doc ID 2269922.1) –
Solved in PT 8.56
QUESTIONS?
Or send email to
[email protected]
Thank you!
This presentation and all Alliance Virtual 2020 presentations
will be available for download from the Conference site at
www.alliance-conference.com