pt851tpsq b0810
pt851tpsq b0810
pt851tpsq b0810
51 PeopleBook:
PeopleSoft Query
August 2010
PeopleTools 8.51 PeopleBook: PeopleSoft Query
SKU pt8.51tpsq-b0810
Copyright © 1988, 2010, Oracle and/or its affiliates. All rights reserved.
Trademark Notice
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their
respective owners.
Warranty Disclaimer
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find
any errors, please report them to us in writing.
Preface
Chapter 1
Chapter 2
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. iii
Contents
Chapter 3
Chapter 4
iv Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Contents
Chapter 5
Chapter 6
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. v
Contents
Appendix A
Appendix B
Appendix C
vi Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Contents
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. vii
PeopleSoft Query Preface
This book discusses PeopleSoft Query, a tool that you use to retrieve selected data from the database.
PeopleSoft Query
PeopleSoft Query is an end user reporting tool. This book explains the basic concepts of selecting data,
designing simple and complex queries, and sending query results to other reporting tools.
To take full advantage of the information covered in this book, you should be comfortable using Microsoft
Windows and should have a basic familiarity with relational database concepts and SQL. In addition, this
book assumes that you have a basic understanding of how to use PeopleSoft applications and are familiar
with PeopleTools.
• How to access hosted PeopleBooks, downloadable HTML PeopleBooks, and downloadable PDF
PeopleBooks as well as documentation updates.
• Navigating the PeopleBooks interface and searching the PeopleSoft online library.
• How to manage the locally installed PeopleSoft online library, including web site folders.
• Understanding documentation integration and how to integrate customized documentation into the library.
You can find this companion PeopleBook in your PeopleSoft online library.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. ix
Chapter 1
You can preview queries within Query Manager, displaying the result set in a grid for review. This option
is useful as you refine your queries.
You can run queries as a separate process and have results sent to a separate browser window by clicking
the HTML link from Query Manager or Query Viewer.
Note. Query Viewer is a read-only version of Query Manager. See "Creating and Running Simple
Queries," Using Query Viewer for additional details.
• To schedule a query.
You can schedule queries to run at predefined times or on recurring schedules. The results of scheduled
queries are routed to PeopleSoft Report Manager.
You can have the data downloaded and formatted as a Microsoft Excel spreadsheet and XML. These
options are available in your query search results, or after you run or schedule a query.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 1
Getting Started with PeopleSoft Query Chapter 1
With Crystal Reports, you can apply advanced formatting to the output of your queries. If you have access
to the Windows version of Query Designer, you can run improvised or predefined queries directly to
Crystal Reports 2008. If you do not have the Windows client installed, you can schedule a predefined
Crystal Report to run on a Process Scheduler server, and have the results routed to PeopleSoft Report
Manager.
See PeopleTools 8.51 PeopleBook: Crystal Reports for PeopleSoft, "Using Crystal Reports 2008,"
Launching Crystal Reports 2008 with Microsoft Windows-based PeopleSoft Query and PeopleTools 8.51
PeopleBook: Crystal Reports for PeopleSoft, "Using Crystal Reports 2008."
You can write queries that PeopleSoft Workflow uses to determine to whom to send emails, forms, or
worklist entries. This type of query is called a role query.
• To serve as a data source for defining online analytical processing (OLAP) Cube Manager dimensions
and facts.
Queries are a primary data source for PeopleSoft Cube Builder and PeopleSoft Cube Manager, which you
can use to build OLAP cubes.
See PeopleTools 8.51 PeopleBook: PeopleSoft Cube Builder, "PeopleSoft Cube Builder Preface" and
PeopleTools 8.51 PeopleBook: PeopleSoft Cube Manager, "PeopleSoft Cube Manager Preface."
• To serve as a data source of the same name for PeopleSoft XML Publisher.
With XML Publisher, you can apply advanced formatting to the output of your queries and streamline
report and form generation.
Queries that are used as data sources for XML Publisher need to be run through Reporting Tools, XML
Publisher to see XML Publisher-related formatting.
See PeopleTools 8.51 PeopleBook: XML Publisher for PeopleSoft Enterprise, "Getting Started with XML
Publisher."
Note. Because PSQUERY is confined by the query limitations that are imposed by the platform on which
PSQUERY runs, invalid queries that result in database errors will also result in errors when constructed and
run through PSQUERY.
2 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 1 Getting Started with PeopleSoft Query
In addition to implementation considerations presented in this chapter, take advantage of all PeopleSoft
sources of information, including the installation guides, release notes, PeopleBooks, red papers, the Updates
+ Fixes area of My Oracle Support, and PeopleSoft's curriculum courses.
See Also
Step Reference
2. Build query access group trees. See PeopleTools 8.51 PeopleBook: Security
Administration, "Implementing Query Security," Building
Query Access Group Trees.
4. Define row-level security and query security records. See PeopleTools 8.51 PeopleBook: Security
Administration, "Implementing Query Security," Defining
Row-Level Security and Query Security Records.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 3
Chapter 2
• Save queries.
• Run queries.
• Download queries.
• Perform lookups.
User query User queries retrieve data from the database directly from Windows-based Query
Designer or the web-based Query Manager/Query Viewer applications.
Note. Because of the range of possible circumstances in which you might run an
ad hoc query, there are no special considerations or requirements that apply to all
of them.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 5
Creating and Running Simple Queries Chapter 2
Reporting query Reporting queries are essentially the same as user queries, except that they are
designed to be used by another reporting tool. Reporting queries can be used as
data sources for ad hoc queries, scheduled queries, Crystal Reports, PS/nVision,
Cube Manager, or XML Publisher.
When you define a custom report, you often include runtime variables that users
specify when they run the report. For example, you might want users to be able
to say which business unit, location, or time period to report on. Therefore, your
reporting query may include one or more runtime prompt variables.
If your query requires input parameters, you must decide how users should enter
them. If they run the report from any of the PeopleSoft Query applications, they
can enter values into the page that appears in Query Manager, Query Viewer, or
Scheduled Query.
When reporting queries are used as a data source to another third party reporting
product, you may need to:
• Create or modify a page to collect the necessary input parameters.
Process query Process queries are queries that you intend to run periodically using a batch
process. Create these automated batch processes using PeopleSoft Application
Engine and the Query API. For example, you could write a query that returns any
overdue receivables and schedule a batch process to run the query once a week.
Note. Process and role queries override the automatic row-level query security
logic that is applied to all other types of queries. For this reason, you should
restrict access to creating these types of queries to administrative roles and not
include any sensitive data columns in the select list for these types of queries.
You can restrict access to creating/modifying these queries based on Query
Profile settings assigned to a Permission List. Also note that Workflow queries
also override the row-level security logic.
6 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Role query PeopleSoft Workflow uses role queries to determine to whom to send an email,
form, or worklist entry. A role query needs to return one or more role IDs based
on the data that has been saved on the page that is triggering the routing.
Because a role query returns a list of role users, the record definition that you
want is either PSROLEUSER (which lists role users and the roles to which they
are assigned) or ROLEXLATOPR (which lists role users and their IDs).
The only field that you select in your query is ROLEUSER. Of course, you use
other fields and join to other record definitions to specify the criteria that role
users can select. But no matter how complex the query is—how many joins or
selection criteria it has—it must return ROLEUSER and nothing more.
Define a role as a query because you want to route items differently based on the
context of the transaction that the users are performing. Thus, every role query
contains at least one bind variable whose value gets set at runtime. The bind
variable or variables correspond to the data on which you want to base the
routing decision. At runtime, the system sets the values of the bind variables
based on data from the page that triggers the event.
Save your role queries with names that begin with [ROLE] so that you can
identify them as role queries.
Note. Process and role queries override the automatic row-level query security
logic that is applied to all other types of queries. For this reason, you should
restrict access to creating these types of queries to administrative roles and not
include any sensitive data columns in the select list for these types of queries.
You can restrict access to creating/modifying these queries based on Query
Profile settings that are assigned to a Permission List. Note that Workflow
queries also override the row-level security logic.
Archive query You can save a query as an archive query if you have access to workflow queries
that include Archive Query, Role Query, and Process Query. These queries are
generally only used by the PeopleSoft Data Archive Manager.
See PeopleTools 8.51 PeopleBook: Data Management, "Using PeopleSoft Data
Archive Manager."
Note. You can only create and save archive queries as public.
PS/nVision query Use PeopleSoft Query to create a query in order to specify the data source for a
PS/nVision report layout. However, if you want to use your query in a
PS/nVision matrix layout, you must apply aggregate functions to at least one
column.
Queries used with PS/nVision tabular layouts do not have the same restrictions as
matrix layout queries; they are like other reporting queries and do not require an
aggregate column.
See Chapter 5, "Working with Advanced Query Options," page 111 and
PeopleTools 8.51 PeopleBook: PS/nVision, "Using Layouts," Understanding
Layouts.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 7
Creating and Running Simple Queries Chapter 2
Dirty Read mode is set in configuration files for PeopleSoft Application server and PeopleSoft Process
Scheduler server:
• In PeopleSoft Application server, under section [PSQRYSRV], the setting 'Use dirty-read' controls
behavior for PSAPPSRV, PSQCKSRV, and PSQRYSRV.
• In PeopleSoft Process Scheduler server, under section [PSAESRV], the setting 'scheduledquery-dirtyread'
controls behavior for scheduled query process executing under PSAESRV process.
See Also
PeopleTools 8.51 PeopleBook: Application Engine, "Application Engine Preface," Application Engine
PeopleTools 8.51 PeopleBook: System and Server Administration, "Setting Application Server Domain
Parameters," Use Dirty-Read
PeopleTools 8.51 PeopleBook: PeopleSoft Process Scheduler, "Managing PeopleSoft Process Scheduler,"
Setting Parameters for the Application Engine Server
Add Record Click this link to access the Query page, where you can add fields to the query
content or add additional records.
Show Fields Click this link to display the fields included in the record.
Col (column) Displays the current column number for each field listed.
Query Name New Unsaved Query appears in this read-only field until you change it on the
Properties page. This field appears on all of the Create New Query pages.
Record.Fieldname Displays the record alias and name for each field listed.
8 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Click the Use as Criteria or Add Criteria button to open the Edit Criteria
Properties page, where you can determine how this field will be used as a
criterion for the current query.
From the Query tab, click the Folder button to view the fields for the chosen
record, if they are not already displayed. Query Manager expands the record so
that you can see the fields and make sure that this record has the content that you
want.
Click the Folder button again to hide the fields for a record.
A key is displayed to the left of key fields.
Save Click to save a query at any time after you have selected one record and at least
one field for it.
See Chapter 2, "Creating and Running Simple Queries," Saving Queries, page
27 and Chapter 4, "Modifying, Scheduling, and Organizing Queries," Updating
Existing Queries, page 97.
Save As Click to access the Query Properties page where you can enter basic information
about the query and save it.
See Chapter 2, "Creating and Running Simple Queries," Saving Queries, page
27 and Chapter 4, "Modifying, Scheduling, and Organizing Queries," Updating
Existing Queries, page 97.
New Query Click to access the PeopleSoft Query Manager where you can start creating a
new query.
See Chapter 2, "Creating and Running Simple Queries," Creating New Queries,
page 10.
Preference Click to access the Preference page where you can specify query preferences.
See Chapter 2, "Creating and Running Simple Queries," Specifying Query
Preferences, page 12.
Properties Click to access the Query Properties page where you can view and edit data
about the current query, such as the query name and description. You can also
record information about your query so that you can use it again in the future.
See Chapter 2, "Creating and Running Simple Queries," Viewing and Editing
Query Properties, page 22.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 9
Creating and Running Simple Queries Chapter 2
Public As Feed This link is available only when query was not published as feed.
Click to access the PSQuery Data Type - Publish Feed Definition page where
you can define feed properties such as the feed title, security, and other options.
See PeopleTools 8.51 PeopleBook: Feed Publishing Framework, "Creating and
Using Query Feeds."
Manage Feed This link is available only when query was published as feed.
Click to access the PSQuery Data Type - Publish as Feed page where you can
define feed properties such as the feed title, security, and other options.
See PeopleTools 8.51 PeopleBook: Feed Publishing Framework, "Creating and
Using Query Feeds."
New Union This link is available only when query does not have union.
Click to create an union of multiple queries.
See Chapter 5, "Working with Advanced Query Options," Working with Unions,
page 114.
Delete Union This link is available only when query have an union attached.
Click to delete an existing union of multiple queries.
See Chapter 5, "Working with Advanced Query Options," Working with Unions,
page 114.
Return to Search Click to return to the Query Manager search page where you can create new
queries, modify existing queries, schedule queries, and organize queries.
See Chapter 4, "Modifying, Scheduling, and Organizing Queries," page 93.
• Select records.
10 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 11
Creating and Running Simple Queries Chapter 2
Edit Field Ordering QRY_FIELDS_ORDER Reporting Tools, Query, Use to change the column
Query Manager. and sort order for multiple
fields.
Create a new query or
search for an existing one.
From the Fields page, click
the Reorder/Sort button.
Edit Field Properties QRY_FIELDS_SEC Reporting Tools, Query, Use to format the query
Query Manager. output; for example, to
change column headings or
Create a new query or
display translate table
search for an existing one.
values in place of codes.
From the Fields page, click
the Edit button to the right
of the desired field.
Query Properties QRY_PROPERTIES Reporting Tools, Query, View and edit data about
Query Manager. the current query, such as
the query name and
Create a new query or
description.
search for an existing one.
Also use to record
With a query open, click the
information about your
Properties link at the bottom
query so that you can use it
of the page (this link
again in the future.
appears on all pages but the
Run page).
View SQL QRY_SQL Reporting Tools, Query, View the underlying SQL
Query Manager. code that Query Manager
generates based on your
Create a new query or
query definition.
search for an existing one.
You cannot modify SQL on
With a query opens, select
this page.
the View SQL tab.
12 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
3. Access the Query Preferences page by clicking the Preferences link on any page of the Query Manager
component (except the Run page).
Name Style Specify how record and field names are displayed. Select one of the following:
• Description only
This is used mostly for global users where the record and field names are in
English but the descriptions are in another language.
Enable Auto Join Select to indicate that your query should automatically determine the join
conditions when a new record component is added.
Enable Auto Preview Select to indicate that your query preview should automatically rerun each time
you access the Run page of the Query Manager component.
This option is selected by default.
See Also
Chapter 2, "Creating and Running Simple Queries," Adding Fields to Query Content, page 15
Chapter 2, "Creating and Running Simple Queries," Previewing Query Results Prior to Saving, page 25
Selecting Records
Use these steps to access the Records page:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 13
Creating and Running Simple Queries Chapter 2
Records page
Note. In your PeopleSoft database, tables are represented as record definitions. In PeopleSoft Query, we refer
to the record definitions as records.
14 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
• If you know the entire record name, description, access group name, or field name included in the
record, select the appropriate item in the Search By drop-down list box.
Enter the name in the field (or click the Look Up button if searching by access group name). Then
click the Search button to display a list of records that match your search criteria.
• You can perform a partial search by entering part of the name in the Search By field.
Note. Enter as much of the name as possible to find the correct record.
• You can perform an advanced search by clicking the Advanced Search link.
You can perform a progressively narrower search by selecting conditions for the record name, record
description, or field name contained in the record, and then entering an appropriate search string in the
fields that correspond to your selections. For access group name, select a condition, click the Lookup
Name button, and then select the access group name from the list of access group trees that appears.
• If you want to view a list of available records, leave the field blank and click the Search button to
display a list of up to 300 records.
By default, only the first 20 records appear on the page. To see more of the list, use the navigation
buttons and links located on the header bar. To display 100 of the records, select the View 100 link,
and use the scroll-bar to go through the rest of the list.
2. If you want to view a record's fields, click Show Fields next to the record in question.
A page displays the record's fields. You can use this information to verify whether you want to base the
query upon this record.
4. Click Add Record next to the record you want to add to the query.
This takes you to the Query field, from which you can select which fields from the selected record to add
to the query.
Note. In most cases, you select only one base record from this page. If you navigate back and select a
second base record, you are creating an any join for the two records.
See Also
Chapter 5, "Working with Advanced Query Options," Creating Any Record Joins, page 117
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 15
Creating and Running Simple Queries Chapter 2
Query page
Click the Sort button once to list fields in alphabetical order. Click the button
again to return to the original sort.
Alias The alias name that the system automatically assigns to the chosen records.
Hierarchy Join Click this link to join a child table to its parent table.
Check All Fields Click this button to check all fields in the record. After you select a field, the
system automatically adds it to the query and you can view it on the Fields page.
This button does not appear when the field names are hidden.
Uncheck All Fields Click this button to clear all fields in the record.
Fields Select the check box to the left of each field that you want to add to your query
content.
Related Record Join Click such links to join two records that are based on a shared field.
For example, in the above example, the QE_DEPT_TBL record is related to the
QE_EMPLOYEE record by the DEPTID field.
Expand All Records Click this button to view all fields in the records
This button appears only when there is more than one record listed.
16 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Collapse All Records Click this button to hide all fields in the records.
This button appears only when there is more than one record listed.
1. Select the fields to add to the query either by clicking their Fields check boxes or by clicking the Check
All Fields button.
2. When you have selected the desired fields, select the Fields tab.
See Also
Chapter 5, "Working with Advanced Query Options," Joining Records, page 115
5. Select the desired fields, and then select the Fields tab.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 17
Creating and Running Simple Queries Chapter 2
Fields page
Ord (order) Shows one or more fields selected to sort your query output.
If the field is the first sort field, a 1 appears, and the system sorts rows that are
based on this field first. The second sort field that is selected is numbered 2, and
so on.
You can also specify a descending sort order. The letter D appears if you are
sorting fields in descending order.
18 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
XLAT(translate) Specifies the translate value that you want to appear in the query results: N
(none), S (short), or L (long).
The table you're querying may include fields that use the Translate table. If so,
the field itself contains a short code of some kind, for which the Translate table
provides a set of corresponding values. For example, if the table includes an
EFF_STATUS field, the value is A or I, which the Translate table translates into
Active and Inactive. If a field has values on the Translate table, a letter appears in
the XLAT column for that field.
In your query results, you might want to display the translated value rather than
the code (for example, Active instead of A). To instruct PeopleSoft Query to
make this substitution, specify L as the translate value.
Translate tables are effective-dated, so you must select which effective date to
use for them. For most tables, PeopleSoft Query defaults to the current date,
meaning that it uses the currently active list of Translate table values. However,
if the table you're querying is also effective-dated, PeopleSoft Query uses the
value in the EFFDT field for a row. That is, for each row the query returns,
PeopleSoft Query uses the Translate table values that were active as of that row's
effective date.
If neither of these effective date options are what you want, you have two more
options:
• If the table you're querying includes another date field, you can use the value
in that field as the effective date for Translate table values.
Click the Edit button, select the Field option, and then select the field name
from the drop-down list box.
• Use an expression to set the effective date for the Translate table.
For example, enter a fixed effective date or prompt the user for a fixed
effective date.
Heading Text The heading assigned to appear at the top of the column for the query output for
each field listed.
Edit Click this button to display the Edit Field Properties page.
See Chapter 2, "Creating and Running Simple Queries," Viewing and Editing
Query Properties, page 22.
Reorder/Sort Click this button to display the Edit Field Ordering page, which enables you to
change the column order and/or sort order for multiple fields.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 19
Creating and Running Simple Queries Chapter 2
New Column Enter the new column number to reorder the columns. Columns that are left
blank or assigned a zero are automatically assigned a number.
New Order By Enter the new sort order number to change the sort order. Enter zero to remove a
sort order. If the field is the first sort field, enter 1, and the system sorts rows
based on this field first. To designate the second sort field, enter 2, and so on.
3. Select the Fields tab, and then click an appropriate Edit button.
20 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Field Name The name of the field for which you are editing properties.
Column Number By default, the fields appear in the same order as they are listed in the record on
the Query page. To change the order for the selected field, enter the new column
number. When you close the Field Properties page, the columns reorder.
• Text: The column heading is the text that you have entered in the text box.
• RFT Short: The column heading is the short name from the record definition.
• RFT Long: The column heading is the long name from the record definition.
Unique Field Name Used for translations. There is no need to change the default value, which is a
single-letter alias for the record followed by the record field name (for example,
A.NAME or B.EMPLID).
Aggregate If you are using aggregate values, select the aggregate function value for this
field.
An aggregate function is a special type of operator that returns a single value
based on multiple rows of data. When your query includes one or more aggregate
functions, PeopleSoft Query collects related rows and displays a single row that
summarizes their contents.
Sum Adds the values from each row and displays the total.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 21
Creating and Running Simple Queries Chapter 2
Min (minimum) Checks the value from each row and returns the lowest one.
Max (maximum) Checks the value from each row and returns the highest one.
Average Adds the values from each row and divides the result by the number of rows.
See Also
Chapter 5, "Working with Advanced Query Options," Working with Aggregate Functions, page 111
3. Click the Properties link on any page of the Query Manager component except the Run page.
22 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Folder Enter the name of the folder in which you would like the query to reside.
To create a new folder, enter the name of the new folder.
• Public: If you select this option, any user with access to the records used by
the query can run, modify, or delete the query (if he or she has access to
public queries).
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 23
Creating and Running Simple Queries Chapter 2
Security Join Optimizer If this query contains multiple joins to the same query security record, define
whether it should be run optimized:
• Select to enable this query to join once to the first security record.
If this is a non-self join (same security tables) or a self join, the query joins
security table once.
If this is a non-self join with different security tables, the query joins security
table multiple times using the Inner Join logic and the Security Join
Optimizer option is not used.
• Clear to enable this query to join multiple times to the security record.
If this is a non-self join with same security tables or a self join, the query
joins security table multiple times using the Inner Join logic.
If this is a non-self join with different security tables, the query joins security
table multiple times using the Inner Join logic and the Security Join
Optimizer option is not used.
Note. The concepts of Security Join Optimizer are also applied when you
perform Left Outer Joins with security records.
Query Definition Free text area that you can use to further describe your query.
See Also
24 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Query SQL Displays the underlying SQL code that Query Manager generates based on your
query definition. To copy the SQL statement, highlight the text of the statement
and copy it using your browser's copy command. Paste it into another
application, if desired.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 25
Creating and Running Simple Queries Chapter 2
Run page
View All Click this link to view all rows and use scroll bar to navigate.
Rerun Query Click this link to rerun your query preview. If you have made changes to your
query since the last preview, you must rerun the query to see the effect of your
changes.
Note. If you do not want to rerun the query every time you want to preview it,
deactivate the Enable Auto Preview feature. When this feature is active, your
query automatically runs each time you select the Run tab. To activate Enable
Auto Preview, click the Preferences link and then select Enable Auto Preview.
(The Preferences link is available on every page except the Run page.)
Download to Excel Click this link to download your query to Microsoft Excel.
Note. To grant users access to download your query to Microsoft Excel, you
must make sure that their permission lists include the WEBLIB_QUERY web
library with full access.
Download to XML Click this link to download your query result as XML format to another browser
window.
Note. To grant users access to download your query to XML, you must make
sure that their permission lists include the WEBLIB_QUERY web library with
full access.
In the Run page, the width of rows are automatically adjusted to show the query results. If the query results
are in double-byte characters (for example, Japanese), rows may wrap vertically.
26 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
3. In the Spacing/Alignment tab, select the Nowrap option from the White Space drop-down list box.
See PeopleTools 8.51 PeopleBook: PeopleSoft Application Designer Developer's Guide, "Creating Style
Sheet Definitions," Setting Style Class Attributes and PeopleTools 8.51 PeopleBook: PeopleSoft Application
Designer Developer's Guide, "Creating Style Sheet Definitions," Specifying Spacing and Alignment.
Saving Queries
You can save a query at any time after you have selected one record and at least one field for it. Save queries
from any Query Manager page (except for the Run page) by clicking either the Save button or the Save As
link. You must enter some basic information about the query before the system allows you to save it for the
first time.
This example shows the information that you must define when you save your query for the first time:
Saving a query
1. After you make your changes in Query Manager (Reporting Tools, Query, Query Manager), click the
Save button.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 27
Creating and Running Simple Queries Chapter 2
4. In the Folder field, enter the name of the folder into which you would like to save the query.
Note. The folder that you create does not reside on your local drive. You create a folder for the purpose of
describing the query and to facilitate grouping and sorting.
Standard queries are designated as User queries. If you have access to workflow queries, your list of types
will also expand to include role, process, and archive.
• Private: Only the user ID that created the query can open, run, modify, or delete the query.
• Public: Any user with access to the records used by the query can run, modify, or delete the query.
Note. Using the Save As link creates another instance of the query that you can modify and save under a
different name. When you click the Save As link, the page you just saw appears enabling you to change the
name, description, and owner of the new query.
Running Queries
You can run a predefined query from your browser and view it online. When you click the Run button on the
Query Manager search page, PeopleSoft Query displays the results in a new browser window. This Run
option is useful if you want to run multiple queries or run the same query multiple times with different
runtime prompt values and compare the results of the queries.
If you want to run queries that you haven't saved, you can use the Run page in the Query Manager.
To run a query:
28 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Both search types enable you to use the following search by criteria: access group name, description,
folder name, owner, query name, type, uses field name, and uses record name. The basic search allows
you to search using the begins with condition. The advanced search enables you to perform a
progressively narrower search by using one or more search by criteria and selecting from a broad choice
of conditions. These are instructions on using search by criteria:
• If you know the entire name of the query that you want to run, select Query Name from the Search By
drop-down list box, and then enter the query name in the Search By field.
If you do not know the name of the query and want to search through a list of queries, leave the
Search By field blank and click the Search button to display a list of up to 300 queries.
Perform a partial search by entering part of the search string in the Search By field.
• To search using any other search by criteria, select the appropriate item from the Search By drop-
down list box, and then enter the search string in the field.
3. To perform an advanced search, click the Advanced Search link on the Query Manager Search page.
On the Advanced Search page, select the appropriate search by criteria and conditions, and then enter a
search string in each of the corresponding fields.
4. Click the Search button to display a list of queries that match your search criteria.
The Search Results page appears. The results list all the queries that match the search criteria. The
following information appears:
• Query name.
• Query description.
• Folder.
By default, only the first 30 queries appear on the page. To see more of the list, click the navigation
buttons and links located on the header bar.
To display 100 of the queries, select View 100 and use the scroll-bar to view the remainder of the list.
6. To run a query, use the following links on the row of the query:
• XML: Click to download query result to browser as webrowset format. There are options that enable
you to open, save, or cancel the downloaded file.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 29
Creating and Running Simple Queries Chapter 2
Note. If a Query—that is used as a data source for XML Publisher— is run through Reporting Tools, Query,
Query Manager, the XML Publisher-related prompts do not appear. The normal basic table-formatted Query
results are generated.
See Chapter 4, "Modifying, Scheduling, and Organizing Queries," Scheduling Queries, page 98.
See Also
PeopleTools 8.51 PeopleBook: XML Publisher for PeopleSoft Enterprise, "Running, Locating, and Viewing
XML Publisher Reports," Running XML Publisher PeopleSoft Query Reports
2. Click Search, and then right-click the HTML link on the Query Manager or Query Viewer search page.
4. Change the text in the Name box to the name of your query.
Internet Explorer adds the query to your Internet Explorer Favorites list.
Downloading Queries
You can download your query to a Microsoft Excel spreadsheet or CSV text file.
After you have downloaded the query to Microsoft Excel, the first row in the spreadsheet displays the total
number of rows of your query that are included in the spreadsheet.
30 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Note. A Microsoft Excel spreadsheet can contain a maximum number of 65,536 rows. If the spreadsheet
cannot include all of the rows in your query, the first row displays—in a red font—the total number of rows
returned by the query. If this number is greater than 65,536, Microsoft Excel spreadsheet does not include the
remaining rows.
If you download your query from the Run page, the query has a different default filename than if you
download your query after clicking the HTML or Excel links. These default filenames are different because:
(a) using the Run page to run queries, queries are run using the application server, and (b) using the HTML or
Excel links, queries are run using a query service.
• HTML: Click this link on the Query Manager or Query Viewer search results page.
• Excel: Click this link on the Query Manager or Query Viewer search results page.
After you click the Excel link, there are options that enable you to save, open, or cancel downloading
query results to Microsoft Excel.
Note. If you have Office 2007 installed, then when doing a download-to-Excel, you might encounter a
Microsoft Office Excel warning message suggesting that you verify that the file is not corrupted and that
it is from a trusted source before opening it. You should click the Yes button in this situation.
The CacheBaseDir= setting in the psappsrv.cfg file specifies the location of temp files that are created by
the Query to Excel execution. Those temp files are removed automatically after the run. If the
CacheBaseDir is not set in the psappsrv.cfg file, all temp files are located under %PS_SERVDIR%.
See Appendix B, "PeopleSoft Query Security," Enabling the Query Access List Cache, page 157 and
PeopleTools 8.51 PeopleBook: System and Server Administration, "Setting Application Server Domain
Parameters," CacheBaseDir.
• XML: Click this link on the Query Manager or Query Viewer search results page.
After you click the XML link, query result will be downloaded to browser as XMLP format and there are
options that enable you to open, save, or cancel the downloaded file. If you click the Open button, XML
formatted query result is downloaded to browser. You can also select the XML option as the format of
your query results in the Schedule Query page when schedule to run a query.
• Download to Excel: Click this link on the Query Manager or Query Viewer Run page.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 31
Creating and Running Simple Queries Chapter 2
• Excel SpreadSheet: This option is available after you have clicked the HTML link on the Query Manager
or Query Viewer search results page. However, you can also click the Download to Excel or Excel links
without downloading the query to HTML.
Microsoft Excel 2000 or later is preferred. If you're using Microsoft Excel 97, click the CSV Text File
link when you need to download large result sets.
You can configure your environment to open the Microsoft Excel file in a separate window or save it as a
file on your local hard drive by modifying the File Type Option settings for Microsoft Excel Worksheets.
Note. Downloaded data such as numbers and dates are formatted in the Microsoft Excel spreadsheet
according to the regional settings on the user's machine.
If you use the Windows or Macintosh operating systems, you can set your downloaded queries to open in
browser windows instead of in the Microsoft Excel application. To set this option in Windows, select the
XLS file type in your folder options and select the Browse in same window check box. When this check
box is cleared, downloaded queries open in the Microsoft Excel application.
• CSV Text File: This option is available after you have clicked the HTML link. If you click this option, the
File Download page appears, at which point you can open the file in your browser or save it to disk.
Note. The output has no formatting and does not support UTF-8 encoded data.
Because Microsoft Excel does not support UTF-8 encoding, the CSV file is written in binary mode with
UCS-2 encoded data. Moreover, Excel does not automatically recognize Unicode-encoded, comma-
delimited files even if they have a .csv extension. Therefore, the user receiving the file will not be able to
open it by double-clicking. Instead, he or she must open it with Excel's File, Open menu and choose the
comma delimiter.
• XML File: This option is available after you have click the HTML link. If you click this option, the File
Download page appears, at which point you can open the XML formatted query result in your browser or
save it to your local machine.
To modify the File Type Option settings for Microsoft Excel Worksheets when using Microsoft Windows
2000:
4. Click the Advanced button, and select or clear the Browse in same window check box.
When working in Microsoft Excel on a query that you have downloaded, adhere to the following guidelines
in order to insert a new column into the spreadsheet, and then add a formula to that column.
When you insert a new column in Microsoft Excel, the new column's cells assume the default format from
one of the adjacent columns—typically the left column. For example, if you insert a column between columns
B and C, the new column takes on the format of column B. If column B is formatted as Text, you cannot
apply a formula to the newly inserted column.
32 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
Note. If the columns adjacent to the newly inserted column have a format of General, you should be able to
apply a formula without performing the following procedure.
In Microsoft Excel, to apply a formula to a newly inserted column of a query that you have downloaded:
2. Change the column's format from text to general by selecting Format, Cells, and then selecting General
from the list of categories on the Number tab.
Performing Lookups
Some queries are designed to prompt you for information when you run them. This approach narrows the
query results to match the information that you entered. To help you enter the correct information, you can
perform a search using the Look Up button that appears on the page.
For example, the ADDRESSLIST query prompts you for a specific employee ID. You might know an
employee's last name, but not have the employee ID handy. Using the Look Up button, you use the
information that you do have to find the required information.
ADDRESSLIST page
To perform a lookup:
3. Click the HTML link from the Query Manager search page for the ADDRESSLIST query name from the
query list.
4. If you know the employee ID for the address that you are looking up, enter it in the EmplID (employee
ID) field; if you need to search for the employee ID, click the Look Up button.
5. On the Look Up page, click the drop-down arrow to find more search values.
In this example, you can select EmplID, Name, or Last Name. To find all values for this field, leave the
search field blank and click the Look Up button. You can also display all of the search fields at once by
clicking the Advanced Lookup link.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 33
Creating and Running Simple Queries Chapter 2
6. Select the value to search by, and then click the Look Up button.
In this example, we know the employee's last name, but not his employee ID.
The Query page appears with the required value already complete.
2. Click the Search button, and then click either the HTML or Excel links.
If you download the query to Microsoft Excel, you can print the query using Microsoft Excel's print function.
If you download the query as a CSV text file, you can print it using the print functions of the applications you
use to work with it.
Note. To grant users access to download your query to Microsoft Excel, you must make sure that their
permission lists include the WEBLIB_QUERY web library with full access.
See PeopleTools 8.51 PeopleBook: Security Administration, "Setting Up Permission Lists," Setting Query
Permissions.
Both search types allow you to select the following search by criteria: access group name, description,
folder name, owner, query name, type, uses field name, and uses record name. The basic search enables
you to search using only the begins with condition. The advanced search enables you to perform a
progressively narrower search by using one or more search by criteria and selecting from a choice of
conditions for each search by criterion.
34 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 2 Creating and Running Simple Queries
To run a query, click the HTML or Excel button to the right of the query on the Search Results page.
Note. After you click the HTML link, you have an option to view the XMLP formatted result in a new
browser by clicking the Download to XML File link on the HTML result page.
To download the results, first click the HTML link associated with the query on the Search Results page.
Then, to download the results to a CSV text file, click the CSV Text File link on the HTML results of the
query.
To download the results to a Microsoft Excel file, click the Excel Spreadsheet link on the HTML results
page.
• Print a query.
See Chapter 2, "Creating and Running Simple Queries," Printing Query Results, page 34.
• Schedule a query.
From the Search results page, click the Schedule link associated with the query. Query Viewer interacts
with PeopleSoft Process Scheduler to enable you to schedule queries. You can submit requests to
schedule a query, check the status of your request using Process Monitor, and view your output using
Report Manager.
See PeopleTools 8.51 PeopleBook: PeopleSoft Process Scheduler, "Using Process Monitor" and
PeopleTools 8.51 PeopleBook: PeopleSoft Process Scheduler, "Using Report Manager."
Note. Online viewing of Query-based XML Publisher reports is available by selecting Reporting Tools, XML
Publisher, View Query Report.
See Also
Chapter 2, "Creating and Running Simple Queries," Previewing Query Results Prior to Saving, page 25
PeopleTools 8.51 PeopleBook: XML Publisher for PeopleSoft Enterprise, "Running, Locating, and Viewing
XML Publisher Reports," Running Reports in Query Report Viewer
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 35
Chapter 3
• Define criteria.
• Define prompts.
• Define expressions.
If you run the query after selecting the fields, the system retrieves all the data in those columns; that is, it
retrieves the data from every row in the table or tables. This might be much more data than you want or need.
You select which rows of data you want by adding selection criteria to the query.
The selection criteria serves as a test that the system applies to each row of data in the tables that you are
querying. If the row passes the test, the system retrieves it; if the row does not pass, the system does not
retrieve it. For example, suppose that you needed the names of all PeopleStore customers who were not
PeopleSoft employees. You would start by creating a query that retrieved the Name and Company fields from
the Customer table. You could then add a selection criterion that enables PeopleSoft Query to scan for rows
where the company name is not PeopleSoft.
In most cases, a selection criterion compares the value in one of a row's fields to a reference value. In the
preceding example, you would compare the value in the Company field to the constant value PeopleSoft. In
other situations, you might compare the value to the value in another record field or to a value that the user
enters when running the query.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 37
Defining Selection Criteria Chapter 3
Defining Criteria
This section discusses how to:
Query QRY_QUERY Reporting Tools, Query, Select a record for the query
Query Manager criteria.
Click the Create New Query
link on the Query Manager
search page.
Click the Search button.
Click the Add Record link
to select a record for the
query.
38 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Edit Criteria Properties QRY_CRITERIA_SEC Reporting Tools, Query, Edit selection criteria
Query Manager, Criteria properties for your query
statement.
Click the Add Criteria
button on the Criteria page
or click the Use As Criteria
link on the Fields page.
Criteria page
Any rows after the first row must include either an AND or OR logical value in the Logical column to specify
whether you want the rows to meet this criterion in addition to other criteria that you have defined or as an
alternative criterion. The first criterion that you define does not have a value in this column. The default for
subsequent criteria is AND.
To reorder the criteria for your query, click the Reorder Criteria button, enter the new positions for the criteria
on the Edit Criteria Ordering page, and click OK. You can also click the Add Criteria button from this
Criteria page to add additional criteria, and you can click the Group Criteria button to group your criteria
logically.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 39
Defining Selection Criteria Chapter 3
3. Access the Criteria page, and click the Add Criteria button.
Alternatively, access the Fields page and click the Use As Criteria link.
Field Select this option if you want to base the selection criterion on another field's
value, usually a field in another record component. To compare the values from
fields in two records, you must join the record components.
When you select this option, you must then select a condition type.
See Chapter 3, "Defining Selection Criteria," Selecting Condition Types, page
41.
Select the appropriate comparison operator from the Condition Type drop-down
list box.
Expression Select this option if you want PeopleSoft Query to evaluate an expression that
you enter before comparing the result to the value in the selected field.
When you select this option and click the New Expression link to create a new
expression, you must then select an expression type. If you are entering an
aggregate value, select the Aggregate Function check box. You can also enter
parameters for length and decimal positions.
Also enter the expression in the text box. Query Manager inserts this expression
into the SQL.
40 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
3. Access the Criteria page, and click the Add Criteria button.
Alternatively, access the Fields page and click the Use As Criteria link.
If you accessed the page by clicking the Use As Criteria link on the Fields page, Query Manager displays
the Edit Criteria Properties page with the selected field populated in the Expression 1 field.
4. In the Edit Criteria Properties page, specify the criteria for the field, and click the OK button to return to
the Fields or Criteria page.
You can also use a field from a record as criteria even if you have not chosen that field for query output.
1. Access the Edit Criteria Properties page by clicking the Add Criteria button on the Criteria page.
The Edit Criteria Properties page appears enabling you to edit Expression 1 and Expression 2 fields.
2. In the Choose Expression 1 Type group box, select the Field or Expression option.
Query Manager also offers a not option that reverses the effect of each condition type. For example, not equal
to returns all rows that equal to would not return.
Note. You should use the not version of an operator rather than the NOT operator on the entire criterion.
When you use NOT, PeopleSoft Query cannot use SQL indexes to speed up the data search. When you use
the not version of an operator, PeopleSoft Query can translate it into a SQL expression that enables it to use
the indexes.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 41
Defining Selection Criteria Chapter 3
between The value in the selected record field falls between two
comparison values. The range is inclusive.
greater than The value in the record field is greater than the
comparison value.
in list The value in the selected record field matches one of the
comparison values in a list.
is null The selected record field does not have a value in it.
You do not specify a comparison value for this operator.
Key fields, required fields, character fields, and numeric
fields do not allow null values.
less than The value in the record field is less than the comparison
value.
42 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Note. If you have selected the EFFDT field on an effective-dated table, PeopleSoft Query also offers special
effective date operators.
The procedure for entering comparison values differs depending on what kind of value you are entering. If
you are comparing one field to another, select the second record field; if you are comparing the rows to a
constant value, enter the constant.
The following table describes all the available value types, the pages that appear based on each comparison
type, and the fields that you must complete in those pages.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 43
Defining Selection Criteria Chapter 3
44 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Tree Prompt Option The value in the selected field enables you to select a
tree value as a tree prompt, when the query is run. This
value type is available only when the selected operator
is in tree or not in tree.
When you select the Tree Prompt Option as the
comparison value, all options to select tree values at
design time are not available. However, you are able to
select tree values as tree prompts when you run the
query.
Effective Seq (effective sequence) Used on some effective-dated records, the effective
sequence is a sequencing number that is provided to
further refine the effective date.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 45
Defining Selection Criteria Chapter 3
Note. Not all value types are available for all operators. For example, when you select the exists operator,
Subquery is the only available value type. After you select an operator, PeopleSoft Query displays only the
value types that are available for that operator.
When you select Constant as your comparison value, the Define Constant page appears. In the text box, enter
the value to which you want to compare the first expression. To add a value by selecting it from a list, click
the Look Up button to display the Select a Constant page.
Note. A list of constants is available only for fields that have translate values or an assigned prompt table.
To select a constant:
2. Select the value that you want from the result list by clicking its associated link.
The Select A Constant page appears again with the selected value in the field. If you are working with a
date field, you can select a date/constant from a calendar.
3. If more than one field exists on the Select A Constant page, you must repeat steps 1 and 2 for each field to
further narrow your search for the constant.
The Edit Criteria Properties page appears with the selected value in the Define Constant page.
46 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
If this example, to select a constant, click a Select Constant link and the Edit Criteria Properties page
reappears with the selected value in the Define Constant section.
When you select In List as your comparison value, the Edit List page appears. Use the Edit List page to build
a list of values for PeopleSoft Query to compare to the value from the first expression. (After you have
created such a list, you can also use this page to select from the list.)
To add a comparison value to the list, click the Look Up button on the Edit List page.
This is an example of the Edit List page, which dynamically reflects which record is used:
List Members Lists the values that have been selected using the Add Value button.
Note. The grid, containing the selected value, appears when a value is selected.
To delete a value, select the check box to the left of the appropriate List Members
value, and click the Delete Checked Values button.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 47
Defining Selection Criteria Chapter 3
Value To add a value, enter it into the Value text box and click the Add Value button.
The value appears in the List Members grid.
To select from a list of values, click the Search button to display the Select a
Constant page. Click the Look Up button to display the Look Up page. Enter part
of a value in the text box. (The system automatically adds a wild card to the end
of the entry, which enables you to do a partial search. For example, if you enter a
value of 10, the system returns all values, (up to a total of 300), that begin with
10, such as 10,100, and 10069.) Click the Look Up button to display the list of
values that corresponds to the search criteria.
Select the desired value from the list by clicking its associated link. When the
Select a Constant page appears again, click the OK button, and the selected value
appears in the List Members grid.
Add Prompt Click to add one or more prompts to the list so that users can enter the
comparison values when they run the query.
Note. The prompts must be defined before you can select them. If no prompts
have been defined, you will receive an error message.
OK Click to accept the values that are listed in the List Members grid.
You will return to the Edit Criteria Properties page, where the selected values are
displayed in the Edit List page.
Cancel Click to return to the Edit Criteria Properties page without saving selections.
You can add one or more prompts to the expression list so that users can enter comparison values when they
run a query.
Note. You must have defined the prompts before you can add them to your expression list.
1. With the expression list open, click the Add Prompt link in the Edit List page to access the Select a
Prompt page.
If you selected the in list operator, you may want to add more than one prompt so that your users can enter
more than one value to search for.
3. To add another prompt, click the Add Prompt link again and select a different prompt.
Because you already have a prompt in place, a different page appears showing the prompt that you have
already added.
48 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
4. To add the next prompt, click the New button and complete the Run-time Prompt page.
The settings for this second prompt are the same as those that are used with the first prompt. If you want a
different label for this prompt, enter that label in the Heading Text text box.
When you click the OK button, the second prompt appears in the Available Prompts list.
5. Highlight the second prompt, and click the Select button to add it to the list of comparison values.
6. Repeat this process for each prompt that you want to add.
When you finish adding prompts, click the OK button to close the Edit List page.
When you select the Tree option as the comparison value (available if you select the in tree or not in tree
condition type), the Select Tree Node List page appears. Use this page to create a list of values for PeopleSoft
Query to compare to the value from the first expression. Click the New Node List link to display the Select
Tree page.
If the Selected Nodes List has been previously populated, you can either:
• Open the previously selected tree, bypassing the Tree Selection page, by clicking the Edit Node List link.
Click the name of the tree that you want to display the Display and Select TreeNodes page, which you can
use to select which element of the tree PeopleSoft Query will check. If no nodes have been previously
selected, the Selected Nodes List grid is collapsed. If you do not know the name of the tree, you can perform
a search for the tree.
This example shows how to select tree nodes in the Display and Select TreeNodes page:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 49
Defining Selection Criteria Chapter 3
1. In the Display and Select TreeNodes page, highlight the desired tree node, and click the Add Node icon.
2. If you know the name of the node that you want, enter the name of the node in the Manual Selection list
box.
Alternatively, click the Look Up button to select the desired node from a list of available nodes. When
you find the node that you're looking for, click the Add to List button to add it to the list. The nodes that
you enter or select from the list appear in the Selected Nodes list box.
3. Remove nodes from the list by clicking the Remove from List icon corresponding to the node to be
deleted.
The selected tree setID, tree name, effective date, and nodes appear in the Select Tree Node List page.
50 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
In addition to the option of selecting the tree value at design time for a criteria, Tree Prompts option will
allow the user an option to select the tree and node value at run time. This allows the user to reuse the same
query to get various organizational reports.
Note. In both web-based Query Manager and Windows client [psqed.exe], while creating a query you have
the option of selecting to enter the tree details either at the design time or at the runtime. There is a Tree
Prompt Option (an expression type) and a Tree Option when you select the condition type as In Tree or Not
In Tree. Based on your selection, the tree option is handled to execute the query accordingly in the specified
modules.
When you select the Tree Prompt Option as the comparison value, all options to select tree values at design
time are not available. However, you are able to select tree values as criteria prompts when you run query.
This is an example of the Edit Criteria Properties with the Tree Prompt Option is selected:
Edit Criteria Properties page with the Tree Prompt Option is selected
• The View SQL page displays the viewable SQL for the in tree prompt.
Note. Since tree information at query design time is not known yet, the SQL in the View SQL page is
different from the SQL that actually runs in the database. When query is finally executed, based on the
user's selection of tree and nodes when prompted, the SQL is modified accordingly with tree info in order
to fetch rows of data.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 51
Defining Selection Criteria Chapter 3
• When you access the Run page, you are prompted for selecting the tree for the specified field and its node
list.
Based on the tree node list that you selected, and after collecting the other prompt values, if any, the
results are displayed on the Run page.
Note. Query that has a criteria with tree prompts cannot be run as part of any process, either via Process
Scheduler or from command line. For example, a crystal process which might need a query that has tree
prompt to be executed to fetch data is not allowed (either by scheduling a process in Process Scheduler or
using psccrun.exe at the command line). Although, you can execute the query with tree prompts from
schedule query.
When you use a PeopleSoft application for day-to-day processing, you usually want the system to give you
the currently effective rows of data—the rows where the effective date is less than or equal to today's date.
You do not want to see the history rows, which are no longer accurate, nor do you want to see future-dated
rows, which are not yet in effect.
When you query an effective-dated table, however, you may want to see some rows that are not currently in
effect. You might want to see all the rows, regardless of their effective dates. Or you might want to see the
rows that were effective as of some date in the past.
1. When you choose the record that has EFFDT as a key field, Query Manager automatically creates default
criteria and adds that criteria to the Criteria page.
This criteria is used to specify which row of data PeopleSoft Query retrieves for each item in the table.
The default is the currently effective row. Defaults are:
52 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
2. If you select one of the comparison options, choose to compare each row's effective date against today's
date or a date other than today.
• Select Current Date to compare each row's effective date against today's date.
• Select Constant to display the Define Constant box so that you can enter a date.
Select this option when you want to see the rows that were effective as of a past date or that will be
effective on some future date.
• Select Expression to display the Define Expression page so that you can enter a SQL expression that
evaluates to a date.
Select this option if you want to prompt users for an effective date when they run the query. You can
add a prompt to the expression that you define in the Define Expression page.
• Select Field to display the Select Field box so that you can select the record field that holds the date to
which you want to compare effective dates.
Select this option when you want to see the rows that were effective at the same time as some other
record. For example, if you're reviewing the list of products on a customer order, you will want to see
the products that were effective on the date of the order.
• Select First Effective Date to return the row with the oldest effective date, usually the first row that is
entered for an item.
• Select Last Effective Date to return the row with the latest effective date, even if that date is still in the
future.
• Removing the Effective Date criterion is equivalent to selecting No Effective Date. The query returns
all rows, regardless of their effective dates.
Note. All options (except No Effective Date) return a single row for each item on the table. If you want a
subset of the rows (for example, all future-dated rows or all history rows), enter a selection criterion in the
Effective Date field. Use the standard comparison operators rather than the Effective Date comparison
operators.
Remember that the effective date operators work differently than the standard comparison operators: they
always return a single effective-dated row. For example, Eff Date <= returns the one row for which the
EFFDT value is most recent, whereas not greater than would return the currently active row and all history
rows.
See Also
PeopleTools 8.51 PeopleBook: Using PeopleSoft Applications, "Using PeopleSoft Application Pages," Using
Effective Dates
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 53
Defining Selection Criteria Chapter 3
When you specify two or more selection criteria for a query, you must tell PeopleSoft Query how to
coordinate the different criteria. For example, suppose you are querying your list of customers and you have
defined two criteria: one selects customers from the state of Washington and another selects customers who
have purchased airplanes. You may want PeopleSoft Query to return only those rows that meet both
conditions (customers in Washington who have purchased airplanes), or you may want the rows that meet
either one of the conditions (all Washington customers plus all customers who have purchased airplanes).
This diagram illustrates the rows that are returned by AND and OR:
When your query includes multiple criteria, link them using either AND, AND NOT, OR, or OR NOT. When
you link two criteria with AND, a row must meet the first and the second criterion for PeopleSoft Query to
return it. When you link two criteria with OR, a row must meet the first or the second criterion, but not
necessarily both.
By default, PeopleSoft Query assumes that you want rows that meet all of the criteria that you specify. When
you add a new criterion, PeopleSoft Query displays AND in the Logical column on the Criteria tab. To link
the criterion using one of the other options instead, select the required option from the drop-down list box.
When your query includes multiple criteria, PeopleSoft Query checks the criteria according to the rules of
logic: it evaluates criteria that are linked by ANDs before those that are linked by ORs. When all the criteria
are linked by ANDs, this order always returns the correct results. When you include one or more ORs,
however, this is not always what you want.
For example, suppose you want a list of customers who are not friends and reside in either California (CA) or
Florida (FL), you would enter the following criteria:
54 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
The set of criteria that was entered in the previous sample page returns a list of customers in California
(except for those who are friends) and all customers in Florida (including those who are friends). This list
results because PeopleSoft Query evaluates criteria in the order of appearance. It looks for rows where the
customer is not friend and where the state is California or rows where the state is Florida.
What you really want PeopleSoft Query to search for are rows where the state is California or Florida, and
where the customer type is not friend. That is, you want PeopleSoft Query to evaluate the OR before the
AND. To accomplish this task, add parentheses to the list of criteria. When a list of criteria includes
parentheses, PeopleSoft Query evaluates the criteria inside the parentheses before the criteria outside the
parentheses.
Using the Group Criteria button on the Criteria page to access the Edit Criteria Grouping page where you can
insert the opening parenthesis just before the field name and the closing parenthesis just after the comparison
value. For example, the following settings of criteria return the results that you want:
Edit Criteria Grouping page, adding parentheses around the last two criteria
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 55
Defining Selection Criteria Chapter 3
To group criteria:
2. Use the edit boxes to enter parentheses for the criteria as needed.
A parenthesis appears at the beginning of the Expression1 column for the first row that you selected and
at the end of the Expression2 column for the last row that you selected. In the previous example, notice
that the AND operator precedes the parentheses, while the OR operator is located within the parentheses.
Defining Prompts
This section provides an overview of prompts and discusses how to edit prompt properties.
Understanding Prompts
Adding a prompt lets you further refine a query when you run it. For example, suppose that you want to
change a query so that you could prompt the user to enter a value for the duration of a vacation. Before you
add the prompt, the query always retrieves rows for employees who had taken vacation based on a defined
constant value on which to make a comparison. Adding a prompt to the query enables the user to enter any
duration, and then the query can return employees based on the value provided when running the query.
When you run a query with a prompt, a prompt page requests the required value. All date, time, and datetime
prompt fields are required fields when running Query. Enter the value into the field. The query uses the value
that you enter as the comparison value for the criterion that included the prompt.
If the field for which you are prompting has an associated prompt table (even if it is the Translate table), the
Edit Table drop-down list box shows its name.
56 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Edit Prompt Properties QRY_PROMPT_SEC Reporting Tools, Query, Edit the prompt properties.
Query Manager, Prompts
Click the Add Prompt
button or the Edit button on
the Prompts page.
4. Click the Add Prompt button or the Edit button on the Prompts page.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 57
Defining Selection Criteria Chapter 3
To define prompts:
1. From the Prompts page, click the Add Prompt button to add a new prompt, or click the appropriate Edit
button to edit an existing prompt.
2. Click the Look Up button next to the Field Name field to select a prompt field.
After you select a prompt field, the name of the field appears. PeopleSoft Query looks to the record
definition for information about this field and completes the rest of the page based on its properties.
Format Specifies the field format. Over a dozen formats are available, including Name,
Phone, Social Security Number, and Zip Code.
Edit Type Defines the type of field edit for the specified field. No Table Edit is the default
value. In general, you should use the same edit type that is used in the field
record definition so that this edit type is consistent throughout Enterprise
PeopleTools.
Heading Type Select a heading type for the prompt from the following values:
• Text: The prompt heading is the free text that you have entered in the text
box.
• RFT Short: The prompt heading is the short name from the record definition.
• RFT Long: The prompt heading is the long name from the record definition.
Heading Text Displays the label for the text box where you enter the comparison value. To
change the text, select Text from the Heading Type drop-down list box, and then
enter the new label in the Heading Text text box.
Unique Prompt Name A default value that Query Manager generates for globalization. Only base
language users can set this value to uniquely identify a query prompt parameter.
Prompt Table If the edit type is Prompt Table, you can select a prompt table to use. If the edit
type is Translate Table, the value in the drop-down list box determines the values
used. PeopleSoft Query assumes that the specified field has translate table values
associated with it, and that the field is identified as a translate table field in its
record definition.
See Appendix B, "PeopleSoft Query Security," page 155.
Note. When using a prompt table on a field from a record definition with multiple keys, you must prompt for
all higher-level keys before lower-level keys. PeopleSoft Query needs values for the higher-level keys to
generate the correct prompt list. Because of this complication, you should not use multikey prompt tables.
58 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
See Also
Chapter 2, "Creating and Running Simple Queries," Adding Fields to Query Content, page 15
In SQL, a HAVING clause is similar to a WHERE clause for rows of data that have been aggregated into a
single row of output. The system evaluates WHERE clauses by looking at the individual table rows before
they are grouped by the aggregate function, and then it evaluates HAVING clauses after applying the
function. So if you want to check the value that is returned by the function, you must define a HAVING
criterion.
When you click the Add Criteria icon from the Fields or Query pages for an aggregate field, new criteria is
added to the Having page instead of the Criteria page. Add selection criteria using the Having page in the
same way that you add selection criteria using the Criteria page.
Keep in mind that PeopleSoft Query compares the result of applying the aggregate function to the comparison
value.
Defining Expressions
This section provides an overview of expressions and discusses how edit expression properties.
Understanding Expressions
Expressions are calculations that PeopleSoft Query performs as part of a query. Use them when you must
calculate a value that PeopleSoft Query does not provide by default—for example, to add the values from two
fields together or to multiply a field value by a constant.
You can work with an expression as if it were a field in the query: select it for output, change its column
heading, or choose it as an "order by" column.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 59
Defining Selection Criteria Chapter 3
1. Select Reporting Tools, Query, Query Manager, then click the Create New Query link, and then select the
Expressions tab to open the Expressions page.
The default for this field is New Unsaved Query until you change it on the Properties page.
3. Click the Add Expression button to open the Edit Expression Properties page, where you can select
expression types.
60 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
If you select Character, enter the maximum length of the expression result in the Length field.
If you select Number or Signed Number, enter the total number of digits in the Length field and the
number of digits after the decimal point in the Decimal field.
Note. For Number and Signed Number, expression types, the Length field defines the total length of the
number (integer portion + decimals portion). For example, if Length = 10 and Decimals = 3, then this
means that the integer portion = 7 (Length - Decimals = Integer).
5. If you are entering an aggregate value, such as SUM, AVG, or COUNT, select the Aggregate Expression
check box.
6. In the Expression Text field, enter the expression (for example, A. Total * .1, where A represents the first
record.)
Query Manager inserts the expression into the SQL for you. You can include Oracle hints in PeopleSoft
Query expressions as long as you adhere to the following rules:
For example, an expression can't have only /*+ or */ . Both must be in the same expression.
7. Click the Add Prompt button to add prompt properties for this expression; click the Add Field button to
add another field to this expression.
Note. You must define a prompt, as described in the next section, before you can add it to your
expression.
MetaSQL enables you to enter an expression that can be used across any supported database. For example, to
concatenate strings, use the MetaSQL %CONCAT, and Enterprise PeopleTools will convert it to the
appropriate database string concatenation function. To create a substring, use %SUBSTRING.
Note. You need to make sure that the expression type and length are set correctly for the data that is going to
be returned. Only the MetaSQL functions that are valid for dynamic views will work with PeopleSoft Query.
See Also
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 61
Defining Selection Criteria Chapter 3
When you build a query using Query Manager, you can define drilling URLs that are associated with this
query. These settings are saved into the database, along with prompt, criteria, and so on, as part of the
metadata for this query. When you execute this query through Query Manager or Query Viewer, the query
results page shows results as links, which you can click to be redirected to a different page in a new browser.
Depending on how drilling URLs are defined, the new browser is either a PeopleSoft Pure Internet
Architecture page, another query result page, or an external page.
62 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Edit Expression Properties QRY_QRYURL_SELECT Reporting Tools, Query, Edit expression properties
Query Manager for your query statement.
Click the Create New Query
link on the Query Manager
search page, or click the
Search button and open an
existing one.
If you create a new query,
click the Search button and
click the Add Record link to
select a record for the
query.
Select the Expressions tab,
and click the Add
Expression button.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 63
Defining Selection Criteria Chapter 3
Query Search Page QUERY_URL_SRCH_SPG Reporting Tools, Query, Searching for a prompt
Query Manager criteria of the query to build
URLs.
Click the Create New Query
link on the Query Manager
search page, or click the
Search button and open an
existing one.
If you create a new query,
click the Search button and
click the Add Record link to
select a record for the
query.
Select the Expressions tab,
and click the Add
Expression button.
Select the Drilling URL
option from the Expression
Type list, and click the
Query URL link.
Click the Prompt Key
button next to the Query
Name field.
64 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Select a Content Reference QRY_CREFURL_SELECT Reporting Tools, Query, Select a content reference or
or Content Reference Link Query Manager content reference link.
Click the Create New Query
link on the Query Manager
search page, or click the
Search button and open an
existing one.
If you create a new query,
click the Search button and
click the Add Record link to
select a record for the
query.
Select the Expressions tab,
and click the Add
Expression button.
Select the Drilling URL
option from the Expression
Type list, and click the
Component URL link.
Enter an External URL QRY_URL_SELECT Reporting Tools, Query, Enter an external URL to
Query Manager build drilling URLs in
external URL format.
Click the Create New Query
link on the Query Manager
search page, or click the
Search button and open an
existing one.
If you create a new query,
click the Search button and
click the Add Record link to
select a record for the
query.
Select the Expressions tab,
and click the Add
Expression button.
Select the Drilling URL
option from the Expression
Type list, and lick the
External URL link.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 65
Defining Selection Criteria Chapter 3
Enter an Attachment URL QRY_ATTURL_SELECT Reporting Tools, Query, Enter an attachment URL to
Query Manager build drilling URLs in
attachment URL format.
Click the Create New Query
link on the Query Manager
search page, or click the
Search button and open an
existing one.
If you create a new query,
click the Search button and
click the Add Record link to
select a record for the
query.
Select the Expressions tab,
and click the Add
Expression button.
Select the Drilling URL
option from the Expression
Type list, and lick the
Attachment URL link.
2. Click the Create New Query link on the Query Manager search page, or click the Search button and open
an existing one.
3. If you create a new query, click the Search button and click the Add Record link to select a record for the
query.
4. Select the Expressions tab, and click the Add Expression button.
66 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Example of the Edit Expression Properties page with the Expression type as Drilling URL
Expression type To define drilling URLs, you must select the Drilling URL option from the
Expression type list.
Expression text Optionally, type the URL in the Expression text text box.
Note. You have two options: type the URL in this Expression Text box or click
the Query URL,Component URL, or External URL links to allow the appropriate
system building URLs. If you type the URL directly into the Expression text box,
the system does not validate against a value for the correct format.
Query URL Click to access the Query URL definition widget, where you can select a query to
build URLs in a query URL format.
Component URL Click to access the Component URL definition widget, where you can select a
component to build URLs in a component URL format.
External URL Click to access the External URL definition widget, where you can enter external
URL to build URLs in an external URL format.
Attachment URL Click to access the Attachment URL definition widget, where you can enter
attachment URL to build URLs in an attachment URL format.
Note. Drilling URLs are saved into database as an expression, so you have the option of accessing the
Expressions page and adding the defined drilling URLs as fields. However, since drilling URLs are a special
type of expression, you cannot add it as a criterion. You can add drilling URLs as query fields just like
regular expressions. On a query result page, values in that column will be expanded to a fully qualified URL,
which you can click to either run a query, access a PeopleSoft Pure Internet Architecture page, or go to an
external URL.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 67
Defining Selection Criteria Chapter 3
2. Click the Create New Query link on the Query Manager search page, or click the Search button and open
an existing one.
3. If you create a new query, click the Search button and click the Add Record link to select a record for the
query.
4. Select the Expressions tab and click the Add Expression button.
68 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Query Name Type a query name in the text box or click the query lookup icon to search for an
existing query.
Prompt Keys Click to access the Query Search Page where you can search for the prompt
criteria of the query that you entered in the Query Name field. If the entered
query has prompt criteria, a list of those fields appears in the URL Keys section.
If the entered query has no prompt criteria, a message appears saying "Query
does not contain any prompt key(s)".
Note. This step is optional. If you do not map any prompt keys to the source
query column field, then when you click a drilling URL link in query result
column page, you will be directed to the Prompt page, where you can enter
prompt key values before retrieving query result.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 69
Defining Selection Criteria Chapter 3
Map Columns Click to display the Map URL to Query Columns section.
Note. This step is required for the drilling URLs to be available in a query results
page.
You can define multiple drilling URLs in a query, but each query result column
can only bind with one URL. Therefore, when you click the Column Mapping
button, only those fields that have no bond with any URL appear in the Map
URL to Query Columns section. If all query columns have bonds with other
tracking URLs, then a message appears saying "All columns have already been
mapped to other drilling URLs."
URL Keys The URL Keys section is available only after you define the Query field and
click the Prompt Keys button.
In this URL Keys section, you define value mapping between Drilling URL
destination query prompt fields and Drilling URL source query result column
fields.
To map these fields, select the key field by selecting the check box adjacent to a
prompt key field, and then click the lookup icon to select the source query
column field to map to it.
Note. This step is optional. If you do not map any prompt keys to a source query
column field, then when you click a drilling URL link on the query result column
page, you will be directed to the Prompt page, where you can enter prompt key
values before you retrieve query results.
Select Query Column Select query result columns to form field name and value pairs and to define the
order of the appended value pair in the URL.
Note. The Select Query Column section is available after you click the Select
Field button.
Map URL to Query The Map URL to Query Columns section is available only after you define the
Columns component values and click the Map Columns button.
Note. This step is required for the drilling URLs to be available in the query
results page.
Use the Map Columns button for binding source query result column fields with
Drilling URL. You must map URL to query result columns in order for the
drilling URLs to be available as links in column fields of the source query
results. You can define column mapping by selecting the appropriate check box
in the Map URL to Query Columns section.
70 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
OK Click to finish defining the Query URL widget and return to the Edit Expression
Properties page.
Access the Query Search page (from the Select a Query page, click the Prompt Keys button).
Use this page to search for the prompt criteria of the query that you entered in the Query Name field of the
Select a Query page. If the entered query has prompt criteria, a list of those fields appears in the URL Keys
section. If the entered query has no prompt criteria, a message appears saying "Query does not contain any
prompt key(s)".
Using the Select Query Column section, you can append field name and value pairs to the end of existing
Drilling URL types. The format of the appended field name and value pair is &FIELDNAME=VALUE.
For example:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 71
Defining Selection Criteria Chapter 3
• '/c/QE_SAMPLE_APPS.QE_DEPT_TBL.GBL?Action=U&DEPTID=%A.DEPTID%&SETID=
%A.SETID%EMPLID=00001:A.SETID'
In this example, the appended field name and value is formed using a static field name, EMPLID, and the
static value 00001. At runtime, the drilling URL is expanded as:
http://rtdc79579vmc:8080/psp/ps/EMPLOYEE/QE_LOCAL/c/QE_SAMPLE_APPS.QE_DEPT_TBL.G
BL? Action=U&DEPTID=10300&SETID=QEDMOEMPLID=00001
• '/c/QE_SAMPLE_APPS.QE_DEPT_TBL.GBL?Action=U&DEPTID=%A.DEPTID%&SETID=
%A.SETID%&A.SETID=%A.SETID%&A.DEPTID=%A.DEPTID%:A.SETID'
In this example, the appended field name and value pairs are from two query result columns, A.SETID
and A.DEPTID. At runtime, the actual values that are returned in the query results for the A.SETID and
A.DEPTID columns replace the %A.SETID% and %A.DEPTID%, as in this URL:
http://rtdc79579vmc:8080/psp/ps/EMPLOYEE/QE_LOCAL/c/QE_SAMPLE_APPS.QE_DEPT_TBL.G
BL?Action=U&DEPTID=10300&SETID=QEDMO&A.SETID=QEDMO&A.DEPTID=10300
Note. You can modify existing drilling URLs either at design time or at runtime.
You can modify existing drilling URLs at design time by entering the static field name and static value
directly into the Expression Text field on the Edit Expression Properties page, as shown in this example:
Edit Expression Properties page, the Expression Text field shows the static field name and static value
You should follow these rules when you enter values directly into the Expression Text field:
• Enter the fieldname and value pair after the component key mapping for a component drilling URL, after
the prompt key mapping for a query drilling URL, and after the external drilling URL.
However, always enter the fieldname and value pair before the query column mapping.
72 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
• Fieldname and value pairs are always formed using the FIELDNAME=VALUE format.
For example:
• '/c/QE_SAMPLE_APPS.QE_DEPT_TBL.GBL?Action=U&DEPTID=%A.DEPTID%&SETID=%A.
SETID%&A.DEPTID=%A.DEPTID%&A.SETID=%A.SETID%TEST=1000:A.SETID:A.DEPTID'
• '/q/?ICAction=ICQryNameURL=PUBLIC.QE_EMP_DESTINATION&BIND1=%A.DEPTID%&A.
DEPTID=%A.DEPTID% TEST=1000:A.SETID:A.DEPTID' '/e/?url=[http://www.yahoo.com]
TEST=1000:A.DEPTID:A.DESCR'
• Fieldname and value pairs can be derived from a query column, static text, or both.
Note. If you want to form a fieldname and value pair by selecting from query result columns, click the Select
Field button on the Select Query URL, Select Component URL, or Select External URL page.
At runtime, the query drilling URL process is able to modify all drilling URLs that are created in PeopleTools
releases 8.50 and 8.51. For example, when you define the same drilling URL:
'/q/?ICAction=ICQryNameURL=PUBLIC.QE_EMP_DESTINATION&BIND1=A.DEPTID:A.DEPTID'
'/c/QE_SAMPLE_APPS.QE_DEPT_TBL.GBL?Action=U&DEPTID=A.DEPTID&SETID=A.SETID:A.
SETID'
'/q/?ICAction=ICQryNameURL=PUBLIC.QE_EMP_DESTINATION&BIND1=%A.DEPTID%
:A.DEPTID' '/c/QE_SAMPLE_APPS.QE_DEPT_TBL.GBL?Action=U&DEPTID=%A.DEPTID%
&SETID=%A.SETID%:A.SETID'
Note. In PeopleTools 8.50, drilling URLs must be expanded correctly. When you modify a drilling URL that
was created in PeopleTools 8.51 and save it in PeopleTools 8.50, the system uses new format and syntax to
form the URL.
In PeopleTools 8.51, when you run a query with the drilling URLs that were directly upgraded from
PeopleTools 8.50, the runtime converts the format differences between the two releases.
2. Click the Create New Query link on the Query Manager search page to create a source query, or click the
Search button and open an existing one.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 73
Defining Selection Criteria Chapter 3
3. If you create a new source query, click the Search button and click the Add Record link to select a record
for the query.
4. Select the Expressions tab, and click the Add Expression button.
5. Select the Drilling URL option from the Expression Type list.
6. Click the Query URL link to define drilling URL for the source query that you just created.
7. Type a query name in the Query Name text box, or click the lookup icon to search for one from existing
queries.
a. Click the Prompt Keys button to bind the prompt keys of the destination query with the columns of
the source query.
Note. If the destination query has prompt criteria, the URL Keys section appears with a list of key
fields.
b. Define value mapping in the URL Keys section by selecting the check box adjacent to a prompt key
field, and then clicking the lookup icon to select a source query column field to map to it.
a. Click the Select Field button to display the Select Query Column section.
b. Select query result columns to form fieldname and value pairs and to define the order of the appended
value pair in the URL.
10. Optionally, define the column mapping in the Map URL to Query Columns section:
a. Click the Map Columns button to map the drilling URL to a source query selected column.
b. Select appropriate values from the Map URL to Query Columns section.
74 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
The Edit Expression Properties reappears with query drilling URLs in the Expression Text field.
and the binding column is A.DEPTID. Thus, this drilling URL is binding with column A.DEPTID.
• Contains two parts: query URL format and query result columns binding with the Drilling URL.
The query results page displays results as links. When you click these links, the destination query is run
using prompt key values that are defined using the source query.
2. Click the Create New Query link on the Query Manager search page, or click the Search button and open
an existing one.
3. If you create a new query, click the Search button and click the Add Record link to select a record for the
query.
6. Select the Drilling URL option from the Expression Type list.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 75
Defining Selection Criteria Chapter 3
76 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Content Reference Enter the name of a content reference or use the Add Content Reference Link
link to select a content reference from an existing list.
See PeopleTools 8.51 PeopleBook: PeopleTools Portal Technologies,
"Administering Portals," Administering Content References.
Add Content Reference Click to access the Select a Content Reference or Content Reference Link page,
Link where you can select a content reference or content reference link.
Note. The values of the Menu Name, Market, and Component fields are
populated if you select a content reference or content reference link using the
Add Content Reference Link link.
Menu Name Enter a menu name or click the lookup icon and select one menu name from an
existing list. Otherwise, the menu name value is populated if you select a content
reference or content reference link using the Add Content Reference Link link.
Market Enter a market code or click the lookup icon and select one market code from an
existing list. The market code is populated automatically if you select a content
reference or content reference link using the Add Content Reference Link link.
Component Enter a component name or click the lookup icon and select one component
name from an existing list. Otherwise, the component name value is populated if
you select a content reference or content reference link using the Add Content
Reference Link link.
Search Keys Click to select mapping between component search keys and source query result
columns.
If the entered component has a search key, a list of those search keys appears in
the URL Keys section. If the entered component has no search key, a message
appears saying "Component does not contain any search keys".
Note. This step is optional. If you do not map any search keys to the source
component, then when you click a drilling URL link in the query result column
page, you will be directed to a component search page, where you can select
search key values.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 77
Defining Selection Criteria Chapter 3
Map Columns Click to display the Map URL to Query Columns section.
Note. This step is required for the drilling URLs to be available in query results
page.
You can define multiple drilling URLs in a query, but each query result column
can only bind with one URL. When you click the Map Columns button, only
those fields that have no bond with any URL appear in the Map URL to Query
Columns section. If all query columns have bonds with other tracking URLs,
then a message appears saying "All columns have already been mapped to other
drilling URLs."
URL Keys The URL Keys section is available only after you define the component and click
the Search Keys button.
In this URL Keys section, you define value mapping between Drilling URL
destination component search keys and Drilling URL source query result column
fields.
To map these fields, select the key field by selecting its check box and, then click
the lookup icon to select source query column field to map to it.
Note. This step is optional. If you do not map any search keys to the source
component, then when you click a drilling URL link in query result column page,
you will be directed to a component search page, where you can enter search key
values before you launch the component.
Select Query Column Select query result columns to form fieldname and value pairs and to define the
order of the appended value pair in the URL.
See Chapter 3, "Defining Selection Criteria," Modify Existing Drilling URLs at
Runtime, page 73.
Map URL to Query The Map URL to Query Columns section is available only after you define the
Columns component values and click the Map Columns button.
Note. This step is required for the drilling URLs to be available in the query
results page.
Use the Map Columns button for binding source query result column fields with
a Drilling URL. You must map URLs to query result columns in order for the
drilling URLs to be available as links in column fields of the source query
results. You can define column mapping by selecting the appropriate check box
in this Map URL to Query Columns section.
OK Click to finish defining a Component URL widget and return to the Edit
Expression Properties page.
Access the Select a Content Reference or Content Reference Link page (from the Select a Component page,
click the Add Content Reference Link link).
78 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 79
Defining Selection Criteria Chapter 3
2. Click the Create New Query link on the Query Manager search page to create a source query, or click the
Search button and open an existing one.
3. If you create a new source query, click the Search button and click the Add Record link to select a record
for the query.
4. Select the Expressions tab, and click the Add Expression button.
5. Select the Drilling URL option from the Expression Type list.
6. Click the Component URL link to define a drilling URL for the source query that you just created.
7. Type a content reference in the text box or click the Add Content Reference Link link to select one from
existing components.
8. If needed, define the values for the Menu Name, Market, and Component fields.
Note. If the selected component has a search key, the URL Keys section appears with a list of search
key fields.
b. Define value mapping in the URL Keys section by selecting an appropriate search field and selecting
a source query results column.
10. Optionally, define query result columns for existing drilling URLs:
a. Click the Select Field button to display the Select Query Column section.
b. Select query result columns to form fieldname and value pairs and to define the order of the appended
value pair in the URL.
11. Optionally, define the map columns in the Map URL to Query Columns section.
a. Click the Map Columns button to map the drilling URL to a source query selected column.
b. Select appropriate values from the Map URL to Query Columns section.
80 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
The Edit Expression Properties page appears with a component drilling URL in the Expression Text field.
and the binding columns is A.SETID:A.DEPTID. Thus, this drilling URL is binding with column
A.DEPTID and A.SETID.
• Contains two parts: component URL format and query result columns binding with the drilling URL.
The query results page displays results as links. When you click these links, destination query is run using
the prompt key value that is defined using the source query.
2. Click the Create New Query link on the Query Manager search page, or click the Search button and open
an existing one.
3. If you create a new query, click the Search button and click the Add Record link to select a record for the
query.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 81
Defining Selection Criteria Chapter 3
6. Select the Drilling URL option from the Expression Type list.
Note. Query URL and component URL have a certain format for key list values in the URL. However,
external URL has no key mapping widget because external URL is free-format URL.
82 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Map Columns After you enter URL value, click this button to display the Map URL to Query
Columns section.
Note. This step is required for the drilling URLs to be available in the query
results page.
You can define multiple drilling URLs in a query, but each query result column
can only bind with one URL. When you click the Map Column button, only those
fields that have no bond with any URL appear in the Map URL to Query
Columns section. If all query columns have bonds with other tracking URLs,
then a message appears saying "All columns have already been mapped to other
drilling URLs."
Select Query Column Select query result columns to form fieldname and value pairs and to define the
order of the appended value pair in the URL.
See Chapter 3, "Defining Selection Criteria," Modify Existing Drilling URLs at
Runtime, page 73.
Map URL to Query The Map URL to Query Columns section is available only after you define the
Columns component values and click the Map Columns button.
Note. This step is required for the drilling URLs to be available in query results
page.
Use the Map Columns button for binding source query result column fields with
a Drilling URL. You must map URL to query result columns in order for the
drilling URLs to be available as links in column fields of source query results.
You can define column mapping by selecting an appropriate check box in this
Map URL to Query Columns section.
OK Click to complete defining External URL widget and return to the Edit
Expression Properties page.
2. Click the Create New Query link on the Query Manager search page to create a source query, or click the
Search button and open an existing one.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 83
Defining Selection Criteria Chapter 3
3. If you create a new source query, click the Search button and click the Add Record link to select a record
for the query.
4. Select the Expressions tab, and click the Add Expression button.
5. Select the Drilling URL option from the Expression Type list.
6. Click the External URL link to define drilling URL for the source query that you just created.
a. Click the Select Field button to display the Select Query Column section.
b. Select query result columns to form fieldname and value pairs and to define the order of the appended
value pair in the URL.
9. Optionally, define the column mapping in the Map URL to Query Columns section.
a. Click the Map Columns button to map the drilling URL to source query selected column.
b. Select appropriate values from the Map URL to Query Columns section.
The Edit Expression Properties reappears with query drilling URLs in the Expression Text field.
The query results page displays results as links. When you click these links, destination query is run using
prompt key value that is defined using the source query.
Note. Currently, PeopleTools supports attachment drilling URLs for SES (Security Enterprise Search). If you
use SEC and belong to theHTTP File View role, you can view the attachment URL file. Otherwise, a message
appears that says you are not authorized for viewing attachments from database using HTTP.
84 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
2. Click the Create New Query link on the Query Manager search page, or click the Search button and open
an existing one.
3. If you create a new query, click the Search button and click the Add Record link to select a record for the
query.
4. Select the Expressions tab, and click the Add Expression button.
5. Select the Drilling URL option from the Expression Type list, and click the Attachment URL link.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 85
Defining Selection Criteria Chapter 3
URL Type Available options are Internal URL and External URL.
URL ID Select a query field that will be used for attachment file name.
Map Columns After you enter URL value, click this button to display the Map URL to Query
Columns section.
Note. This step is required for the drilling URLs to be available in the query
results page.
You can define multiple drilling URLs in a query, but each query result column
can only bind with one URL. When you click the Map Column button, only those
fields that have no bond with any URL appear in the Map URL to Query
Columns section. If all query columns have bonds with other tracking URLs,
then a message appears saying "All columns have already been mapped to other
drilling URLs."
Select Query Column Select query result columns to form field name and value pairs and to define the
order of the appended value pair in the URL.
Map URL to Query This section is available only after you define the component values and click the
Columns Map Columns button.
Note. This step is required for the drilling URLs to be available in query results
page.
Use the Map Columns button for binding source query result column fields with
a Drilling URL. You must map URL to query result columns in order for the
drilling URLs to be available as links in column fields of source query results.
You can define column mapping by selecting an appropriate check box in this
Map URL to Query Columns section.
OK Click to complete defining External URL widget and return to the Edit
Expression Properties page.
2. Click the Create New Query link on the Query Manager search page to create a source query, or click the
Search button and open an existing one.
86 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
3. If you create a new source query, click the Search button and click the Add Record link to select a record
for the query.
4. Select the Expressions tab, and click the Add Expression button.
5. Select the Drilling URL option from the Expression Type list.
6. Click the Attachment URL link to define drilling URL for the source query that you just created.
a. Click the Select Field button to display the Select Query Column section.
b. Select query result columns to form fieldname and value pairs and to define the order of the appended
value pair in the URL.
9. Optionally, define the column mapping in the Map URL to Query Columns section.
a. Click the Map Columns button to map the drilling URL to source query selected column.
b. Select appropriate values from the Map URL to Query Columns section.
The Edit Expression Properties reappears with query drilling URLs in the Expression Text field.
• If URL type is external, its attachment drilling URL always begins with '%URLID:. For example:
'%URLID:FILEDB%%A.MESSAGE_NBR%'.
Notice that drilling URL runtime replaces %A.MESSAGE_NBR% with actual query field column value
of 1. Drilling URL runtime also replace FILEDB with record://PSFILE_ATTDET. FILEDB is
defined as record://PSFILE_ATTDET in the URL page that can be set using this navigation
path: PeopleTools, Utilities, Administration, URLs.
• If URL type is internal, its attachment drilling URL always begins with '/s/. For example:
'/s/WEBLIB_FILEHTTP.ISCRIPT1.FieldFormula.IScript_GetAttachment?urli
d=FILEDB&filename=%A.MESSAGE_NBR%'.
Notice that drilling URL runtime replaces %A.MESSAGE_NBR% with actual query field column value
1.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 87
Defining Selection Criteria Chapter 3
• Runs the destination query with prompt key values if the source query has prompt criteria defined and
prompt keys are mapped to source query result columns.
• Launches the component with the search key values if the source query has search keys defined and
search keys are mapped to source query result columns.
On the Run page, when you click the Download to Excel link to download query results to a Microsoft Excel
spreadsheet, an Excel spreadsheet is launched with links to respective cells. When you click the Excel link
from Query Manager or the Query Viewer search results page, you get similar query results.
This is an example of query results in Microsoft Excel when you click the Excel link in Query Manager or
Query Viewer. Note that the URL appears when you hover the mouse over a cell:
88 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
You can also view the query results of a query that has drilling URL defined using the HTML links in Query
Manager or Query Viewer.
This is an example of query results as links when you click the HTML links in Query Manager or Query
Viewer:
• You can click the Excel Spreadsheet link to download query results to Microsoft Excel.
Note. The Excel Spreadsheet link in this query result page has the same usage as the Excel link in Query
Manager or the Query Viewer search result page.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 89
Defining Selection Criteria Chapter 3
• You can click the CSV Text File link to download query results into a CSV format file.
Note. Because CSV file is opened using a text editor such as Notepad and links do not apply to text
editors, unlike HTML and Excel, no links exist in the CSV format file. However, if you select drilling
URL as query selected field, then the drilling URL appears in a fully expanded version.
This is an example of query results in PDF format. Note that the URL appears when you hover the mouse
over a cell:
If drilling URL is defined in the query, then no links exist in the result file for TXT and XML formats.
However, if you select drilling URLs as a query selected field, drilling URLs are shown in a fully expanded
version.
90 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 3 Defining Selection Criteria
Note. Theoretically, one query can have multiple drilling URLs defined; however, the number of URLs for
each query should be limited to enhance performance. For queries that return a large number of results,
having multiple URLs defined would slow query execution time.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 91
Chapter 4
• Modify queries.
• Schedule queries.
• Organize queries
Modifying Queries
This section discusses how to:
• Rename queries.
• Delete queries.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 93
Modifying, Scheduling, and Organizing Queries Chapter 4
94 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 4 Modifying, Scheduling, and Organizing Queries
Both search types enable you to select from the following search by criteria: access group name,
description, folder name, owner, query name, type, uses field name, and uses record name. The basic
search enables you to search using the begins with condition. The advanced search enables you to perform
a progressively narrower search using one or more search by criteria and selecting from a choice of
conditions for each search by criterion.
• To perform a basic search by name, enter the name of the query in the Search By field and click the
Search button.
If you do not know the name of the query and want to search through a list of queries, leave the
Search For field blank and click the Search button to display a list of up to 300 queries.
Perform a partial search by entering part of a query name or description in the Search By field. Use
the drop-down list box to search queries by either name or description, and then click the Search
button to display a list of queries that match your search criteria.
The Search Results page appears and lists all the queries that match the search criteria. The following
information appears: query name, query description, and ownership (public or private).
• If you know the name of the query that you want, enter it in the Search By field and click the Search
button.
On the advanced search page, select the appropriate search by criteria and conditions and enter a
search string in each of the corresponding fields. Then click the Search button to display a list of
queries that match your search criteria. The Search Results page appears listing the query name,
description, owner, and folder for all the queries that match the search criteria.
3. Click the Edit link on the row of the query that you want to modify.
See Also
Renaming Queries
You can rename existing queries using the Rename Queries page, as shown:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 95
Modifying, Scheduling, and Organizing Queries Chapter 4
To rename a query:
2. On the Admin (Administration) page, select a predefined search or a manual search by clicking the
respective Search button.
The Rename Queries page appears, listing the current query names and query owners.
5. Enter new names for the queries in the New Name field.
Note. Alternatively, you can use the Query Manager search page (Reporting Tools, Query, Query Manager)
to rename a query. You must first select a query that you want to rename, and then select Rename Selected
from the Action drop-down list box.
Deleting Queries
You can delete any public query that you have access to as well as any private query that you have created.
To delete a query:
2. On the Admin (Administration) page, select a predefined search or a manual search by clicking the
respective Search button.
4. Click the Yes button to confirm the deletion or click the No button to avoid deletion.
96 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 4 Modifying, Scheduling, and Organizing Queries
Note. Alternatively, you can use the Query Manager search page (Reporting Tools, Query, Query Manager)
to delete a query. You must first select a query that you want to delete, and then select Delete Selected from
the Action drop-down list box.
2. On the Query Manager Search Results page, find the query that you want to modify and click its Edit link.
3. Access the tab that you want to modify the information—except the Run tab.
5. Click either the Save button to update the existing query, or the Save As link to save a different instance
of the query under a new name.
Note. When using Microsoft Windows-based Query Designer, any modification to a previously saved query
must be saved before downloading query results to Microsoft Excel or to Crystal Reports 2008. A message
will appear reminding you to save your work. This is to ensure that accurate data are displayed. New ad hoc
queries that have never been saved before in the database can be downloaded to Microsoft Excel and to
Crystal Reports 2008 without having to save after every modification.
Problem Action
Field deleted from the record definition is a selected The field is removed from the selected list.
field.
If the field is the only field selected, the query cannot be
saved.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 97
Modifying, Scheduling, and Organizing Queries Chapter 4
Problem Action
Field deleted from the record definition is used in an The field is removed from the expression.
expression.
This may result in an invalid expression, but the query
can be saved.
Field deleted from the record definition is used in a The criterion is removed. If criterion is a subquery
criterion. criterion, all lower subqueries are deleted.
Record deleted is the first record in the query. Error returned. The query cannot be repaired.
Record deleted is not the first record in the query. The record and all fields are removed.
Record deleted contains hierarchy joins below it. Record and all records joined below are removed.
Note. If a record has been deleted, the query no longer appears in the list of queries because you no longer
have access to all of the records in that query. To open such a query, you need to use Query API.
See Also
PeopleTools 8.51 PeopleBook: Security Administration, "Setting Up Permission Lists," Setting Query
Permissions
Scheduling Queries
Query Manager interacts with PeopleSoft Process Scheduler to enable you to schedule queries.
98 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 4 Modifying, Scheduling, and Organizing Queries
2. Search for and select an existing run control ID, or select the Add New Value tab to enter a new ID.
3. Select the query for which you want to schedule and update any prompt parameters.
Use the Update Parameters link to select or change the value that is required for each available prompt.
When values have been selected, they appear in the Prompt Name and Value fields.
Note. If the query does not have any prompt, the Update Parameters link does not appear.
If you have one or more Asian languages installed, select the language that you want from the Asian Font
drop-down list box. This drop-down list box appears only if you have one or more Asian languages
installed.
You are unable to open or schedule a query that has been disabled.
4. Click the Save button to save changes and remain on the Schedule Query page.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 99
Modifying, Scheduling, and Organizing Queries Chapter 4
5. Click the Run button to submit the query process request and display the Process Scheduler Request page.
When you are scheduling queries from Query Manager or Query Viewer, the Run button is replaced with
an OK button.
6. Click the Process Monitor link to view the status of your request; click the Report Manager link to view
the output of your request.
Note. If a Query that is used as a data source for XML Publisher is run through Reporting Tools, Query,
Schedule Query, the XML Publisher-related prompts do not appear. The normal basic table-formatted Query
results will be generated.
See PeopleTools 8.51 PeopleBook: PeopleSoft Process Scheduler, "Submitting and Scheduling Process
Requests" and PeopleTools 8.51 PeopleBook: XML Publisher for PeopleSoft Enterprise, "Running, Locating,
and Viewing XML Publisher Reports," Scheduling Reports in Query Report Scheduler.
You can schedule queries that have tree prompts using the Schedule Query component or using the Schedule
links in the Query Manager and Query Viewer. While scheduling these queries, you are prompted for
selecting the tree for the specified field and its node list. After the successful selection of values for the tree
prompts, other prompts are available for your input. These queries can either be saved and used in the future
or can be scheduled and run immediately by clicking the Run button.
This is an example of the Schedule Query page when you run a query that has a criteria with tree prompt:
100 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 4 Modifying, Scheduling, and Organizing Queries
Update Tree Parameters The Update Tree Parameters link is available if you are running queries that have
tree prompts.
Click this link to access the Select a Tree page and the Select Tree Node page,
where you can select a tree and its node list.
Tree Prompts The Tree Prompts section displays the field names and expression texts, which
will be used in forming the SQL before running the query.
Note. In Windows query application psqed.exe, you also can create tree prompts and use that prompts to enter
input at runtime. Execution of the query is similar to PIA Query Manager, where you select the tree node to
run the query.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 101
Modifying, Scheduling, and Organizing Queries Chapter 4
Server Name Select the name of the server on which you want the process to run.
Recurrence Select the recurring time intervals for the process to run.
For example, to run a process every weekday at 5:00 p.m., select the
predefined recurrence definition M-F at 5pm.
Time Zone Select the time zone in which the process will run.
For example, you might be in Eastern Standard Time (EST) and schedule a
process to run in Pacific Standard Time (PST).
Run Date Select the date on which you want the process to run.
Run Time Select the time at which you want the process to run.
Reset to Current Click to reset the run date and time to the present date and time.
Date/Time
Select Select a job or process to run.
You can select multiple jobs and processes.
Process Name and Identifies the name and type (such as COBOL or Crystal) of the process as it
Process Type appears in the process or job definition.
102 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 4 Modifying, Scheduling, and Organizing Queries
Note. If you set Type value to File or Printer, you must enter the name of
the directory in the Output Destination field.
• Printer: Sends the output to a printer. You can enter a custom printer
location in the Output Destination field if you have the appropriate
security access. If the Output Destination field is left blank, the printer that
is defined on the Process Profile Permissions page is used. If that printer is
undefined, the default printer that is defined for the process scheduler is
used.
Note. Using Scheduled Query, you can schedule queries to run and have
the results email directly to recipients as an attachment. If a report fails to
run, no email is sent. If a query result includes a file without data, the
report headers or other text are sent in email that indicates that the report
was empty. If no file is found, the email will contain a meaningful
message to inform recipients. If sending email is successful, process status
is be marked as success; otherwise, it ends in error. If the generated output
file is too large, the email is returned to the sender with information to
indicate any attachment size limitations.
You have to enter query prompts values, select the Format as Atom, and
select a feed definition which matches the query prompts values. If there
are no existing feeds with matching prompt values, all the scheduled feeds
appear. You can select any scheduled feed to make a copy of that feed and
later also change the title of the new cloned feed.
• Web: Sends all output of the process to the report repository, including log
and trace files. The format of the report is specified by the format list.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 103
Modifying, Scheduling, and Organizing Queries Chapter 4
• Window: Sends the output to a new browser window. The status of the
process now appears in the new browser window before the results are
displayed. The different statuses are Queued,Initiated,Processing,Success,
Error, or Warning. All output for the process is also sent to the report
repository, including log and trace files. The format of the report is
specified by the format list.
Note. This output type is not available if the user does not have REN
Server Report Window permission, or if no active REN Server cluster is
available for Reporting.
To grant access to the new browser window, the permission lists of the
users must include full access for the Realtime Event Notification for
Reporting Window and the WEBLIB_RPT web library with full access.
Note. An output format that is selected for a job at the main job level carries
through to the job items. The format that is selected for individual processes or
jobs that are attached to a job overrides the format that is entered for the parent
job.
To get text-wrapping support for very long text fields, use HTML format.
PDF format has a maximum page width size of approximately 353 cm and it
does not support text-wrapping. All output columns must fit within this limit.
A column's size will be as wide as the longest text it has to accommodate. If a
text field's length needs more than 353 cm of space, the text may go beyond its
column border and successive columns will not print.
XML format is for producing webrowset XML format result. XMLP format is
producing XMLP format result.
Distribution Click to access the Distribution Detail page, where you enter additional
distribution information when the output type is Web,Window, or Email. Also
use this page to select a folder name to which the output should be distributed
when the output type is Web or Window.
104 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 4 Modifying, Scheduling, and Organizing Queries
Output Destination Enter the file directory path or printer destination for the output. For example,
C:\Documents and
Settings\admin\psft\pt\8.50\appserv\prcs\QEDMO\log_output.
Note. This field is available only when the output type that you select is File
or Printer. If you select an output destination (OutDest) for a process at the
process definition level, this field is populated with that output destination.
The system displays the Schedule Query page. The process instance number appears below the Run
button.
5. Click the Process Monitor link to view the status of your request.
The Process List page appears. The Run Status field reveals the status of your scheduled or running
process.
You can access the Process Monitor by clicking the Process Monitor link on the Schedule Query page or by
selecting PeopleTools, Process Scheduler, Process Monitor.
Process Monitor consists of two pages: the Process List page and the Server List page.
• The Process List page enables you to monitor the process requests that you have submitted.
You can select filtering options—for example, process type and run status—to view only selected process
requests. And you can click the Details link to view details that are associated with particular process
requests.
• The Server List page enables you to monitor the PeopleSoft Process Scheduler server agents within your
system.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 105
Modifying, Scheduling, and Organizing Queries Chapter 4
User ID View the processes that were submitted by a particular user ID.
Usually, you view by your own user ID.
Last Specify an interval of time by which to limit the process requests that appear in
the list.
Enter a numerical value in the edit box preceding the drop-down list box, and
then select a unit type from the drop-down list box. Values are Days, Hours, and
Minutes.
Instance Specify a range of instances by which to limit the process requests that appear in
the list.
To limit the view to a single request, enter the required instance ID in the first
text field.
Run Status Select if you want to view processes by a specific status, such as Success or
Error.
Distribution Status Displays the distribution status for each individual job and process.
Valid statuses are N/A,None,Generated (OS390),Not Posted,Posting, and Posted.
106 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 4 Modifying, Scheduling, and Organizing Queries
Save On Refresh Select to save filter criteria changes when you click the Refresh button.
Instance Displays the process instance, that is, the order in which the process appears in
the queue. This number is automatically generated.
Seq (sequence) This field is blank; it is not used for query processes.
You can view all of your reports by opening your Report List in your browser.
To access the Report Manager, select Reporting Tools, Report Manager, or click the Report Manager link on
the Schedule Query page.
Note. XML Publisher reports can also be viewed by navigating to Reporting Tools, XML Publisher, XMLP
Report Search.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 107
Modifying, Scheduling, and Organizing Queries Chapter 4
See Also
PeopleTools 8.51 PeopleBook: Using PeopleSoft Applications, "Working With Processes and Reports"
PeopleTools 8.51 PeopleBook: XML Publisher for PeopleSoft Enterprise, "Running, Locating, and Viewing
XML Publisher Reports," Searching the XML Publisher Report Repository
Note. Most PeopleSoft components can use the international settings from the browser by default if the user
has not set any user specific settings. However, this is not available for scheduled queries or any PeopleSoft
Process Scheduler processes.
See Also
Organizing Queries
This section discusses how to:
Note. Although you can view a list of favorites, you can't create a list of favorites in the Query Viewer.
108 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 4 Modifying, Scheduling, and Organizing Queries
2. On the Query Manager Search Results page, select the query that you want to add to the My Favorite
Queries list.
3. Select the Add to Favorites option from the Action drop-down list box.
Note. You can add multiple queries to the My Favorite Queries list at once by selecting several queries before
selecting Add to Favorites and clicking the Go button.
Note. You can copy only nonpublic queries to another user's list of queries.
If the target user does not have permission to access all of the records in a copied query, that query does not
appear in the target user's list of queries. When permission has been granted, the query appears in the list.
2. On the Query Manager search results page, select the query or queries that you want to copy.
3. Select the Copy to User option from the Action drop-down list box.
5. Enter the user ID of the user to whom you want to copy the query.
2. On the Query Manager search results page, select the query or queries that you want to move to an
organization folder.
3. Select the Move to Folder option from the Action drop-down list box.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 109
Modifying, Scheduling, and Organizing Queries Chapter 4
• Select an existing folder to move to: From the drop-down list box, select the folder to which you want
to move the queries.
• OR enter a folder name to move to: Enter the name for a new folder to which you want to move the
queries.
110 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 5
• Join records.
Note. Familiarity with SQL is helpful when writing more advanced queries.
An aggregate function is a special type of operator that returns a single value based on multiple rows of data.
When your query includes one or more aggregate functions, PeopleSoft Query collects related rows and
displays a single row that summarizes their contents.
For example, suppose that your Order table includes (among other fields) a customer ID and an amount for
each item that was ordered. You want to determine how much each customer has ordered, so you create a
query that selects the customer ID and amount fields. Without any aggregate functions, this query would
return the same number of rows as are in the table. If Stuart Schumacher ordered 10 items, you would see 10
rows with his ID in the customer ID column. On the other hand, if you apply the aggregate function Sum to
the amount field, you will get just one row for each customer ID. PeopleSoft Query collapses all the rows
with the same value in the non-aggregated column (customer ID) into a single row. The value of the amount
field in Stuart Schumacher's row would be the sum of the values from the 10 rows.
The following table lists the aggregate functions that you can apply to a field using PeopleSoft Query:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 111
Working with Advanced Query Options Chapter 5
Sum Adds the values from each row and displays the total.
Min (Minimum) Checks the value from each row and returns the lowest
one.
Max (Maximum) Checks the value from each row and returns the highest
one.
Average Adds the values from each row and divides the result by
the number of rows.
Note. If you do not want PeopleSoft Query to redefine the field in this way—for example, if you want to
display both the individual row values and the results of the aggregate function—create an expression that
includes the aggregate function rather than applying the function directly to the field.
3. Click the Edit button that is associated with the appropriate field.
4. Select the aggregate function that you want to use for this field, and click the OK button.
The abbreviation for the selected function appears in the Agg (Aggregate) column. If a function is not
available for the field that you have selected, the Edit Field Properties page does not close. For example,
you cannot use Sum with a character field, but you can use Count, Min, and Max.
Note. In addition to the previously listed aggregate functions, you can use any aggregate function that is
supported by the underlying database by creating an expression component.
112 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 5 Working with Advanced Query Options
See Also
You create a subquery when you need to compare a field value to the results of a second query. Suppose, for
example, that you want a list of employees who are not members of any professional organizations. For each
employee in the PERSONAL_DATA table, you must determine whether his or her employee ID is in the
MEMBERSHIP table. That is, you must compare the value in the PERSONAL_DATA.EMPLID field to the
results of a subquery that selects the EMPLID values from the MEMBERSHIP table.
The following example show the Criteria page when you are using a subquery:
The following example shows the Query page when you are creating a subquery:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 113
Working with Advanced Query Options Chapter 5
To create subqueries:
2. Click the Use As Criteria link on the Query page, or click the Add Criteria button on the Criteria page.
3. On the Edit Criteria Properties page, select Subquery as the comparison value.
PeopleSoft Query displays a special Query Manager view where you can select a record. See the example
of the Query page with subquery above.
Note. A subquery can have only one field. However, you can create multiple subqueries.
When you have defined subqueries and unions, a Subquery/Union Navigation link appears at the top of
each page of the main query and the subqueries.
5. Click the Subquery/Union Navigation link to display a hierarchical view of the main query and all
subqueries and unions.
Use the hierarchy to navigate between the main query, subqueries, and unions.
114 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 5 Working with Advanced Query Options
Note. Translate values, both the long and short descriptions, cannot be displayed in a union query. Only the
code for the field can be selected for output display.
Similarly, values from the related language record are not retrieved for union queries.
You must understand SQL to ensure that you create logical union queries.
In Oracle databases, PeopleSoft LongCharacter fields use the CLOB datatype when their length definition
exceeds 1333. Since CLOBS (and other binary datatypes) are not valid columns for all operators, all queries
including columns with LongCharacter field length definition that exceeds 1333 should not include the
UNION operator.
To create a union:
1. Click the New Union link, which is available on the bottom of each Query Manager page except for the
Run page.
PeopleSoft Query automatically switches to the Records tab so that you can start defining the second
query. Define that query in the same way that you define other queries.
When you're working on a union, each individual selection looks like an independent query, and for the
most part they are independent. However, the first selection in the union—the one that you started before
clicking the New Union link—has a special status. PeopleSoft Query determines the ordering of the rows
and columns based on what you specify for the first selection. It also uses the column headings that you
defined for the first selection.
2. Navigate between the main query, subqueries, and unions using the Subquery/Union Navigation link.
Joining Records
Query Manager enables you to create queries that include multiple-table joins. Joins retrieve data from more
than one table, presenting the data as if it came from one table. PeopleSoft Query links the tables, based on
common columns, and links the rows on the two tables by common values in the shared columns.
Joins are what make relational databases relational. Using joins, you define relationships among fields when
you query the records, not when you create the records. Because PeopleSoft records are highly normalized
(they each describe one kind of entity), you can easily use Query Manager to create joins.
The procedure for joining tables differs depending on how the tables that are being joined are related to each
other. Query Manager recognizes three types of joins: record hierarchy, related record, and any record.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 115
Working with Advanced Query Options Chapter 5
Note. You can specify the parent/child relationship using the Parent Record Name option in PeopleSoft
Application Designer.
This example shows how to perform hierarchy joins with the ABSENCE_HIST record is selected:
1. In Query Manager (Reporting Tools, Query, Query Manager), select the base record for your query.
All of the records that have a parent/child relationship with your selected record appear.
The following example shows that you can join the QEDMO Employee record to the JobCode record by
using the QE_JOBCODE field, or you can join the QEDMO Employee record to the Data Department Table
by using the DEPTID field:
116 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 5 Working with Advanced Query Options
1. In Query Manager (Reporting Tools, Query, Query Manager), select the base record for your query.
3. From the Query page, click the Related Record Join link.
4. From the Select Join Type page, select the standard join option and click the OK button.
If you have the Enable Auto Join preference selected in the Query Preferences page, PeopleSoft Query
automatically attempts to join the new record to the existing record by looking for matching columns on the
two records.
To access the Query Preferences page, click the Preferences link on any page of Query Manager.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 117
Working with Advanced Query Options Chapter 5
Note. You can create an outer join using this method only if you have an Oracle database. If you use a
platform other than Oracle database, you can create an outer join equivalent or create a left outer join using
PeopleSoft Query's left outer join feature.
See Chapter 5, "Working with Advanced Query Options," Creating Left Outer Joins, page 119.
To create an outer join, you must include a plus sign in parentheses (+) after the key fields of the subordinate
record in the criteria that link the records. To produce this syntax, you cannot use the predefined joins. You
must perform an any record join and code an expression that contains the (+) instead of a field.
You can join only one child record to the same parent query when the child record is added using the Records
page. If you join more than one child record to the same parent query, an error message appears that says:
"Left Outer joins must be joined to the last record in the query". On the contrary, you can have multiple outer
joins to the same parent table if those joins are added using the Hierarchy joins link in the Query page.
1. Access the Criteria page (Reporting Tools, Query, Query Manager, Criteria).
2. From the Criteria page, click the Edit button to the right of the required field from the primary record.
3. In the Condition Type drop-down list box, accept the default operator value of Equal To.
118 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 5 Working with Advanced Query Options
If you use a platform other than Oracle, use this method to achieve the same effect as an outer join.
Note. If you use a platform other than Oracle, you can also create a left outer join using PeopleSoft Query's
left outer join feature.
See Chapter 5, "Working with Advanced Query Options," Creating Left Outer Joins, page 119.
For example, to retrieve a list of all students and any evaluation information on file, the first select must
retrieve those students who have not completed an evaluation; the second select must retrieve those students
who have completed an evaluation.
1. In Query Manager (Reporting Tools, Query, Query Manager), create a new query or updating an existing
query using the Student_Data record.
Because you will select two different fields from the Student_Eval record and you want them to have their
own columns, you must create two dummy fields for your first record.
5. Create your subquery to find those students who have not completed an evaluation.
This completes your first select. If you run the query at this point, you see only those students who did not
complete an evaluation.
7. Using the Student_Data record, select Customer_ID and Name for output.
1. On the Query Manager search page (Reporting Tools, Query, Query Manager), click the Create New
Query link.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 119
Working with Advanced Query Options Chapter 5
2. On the Records page, search for the first (left) record for the left outer join.
3. Click the Add Record link on the same row as the record that you want to add.
6. Find the joining record and then click the Join Record link on the same row as that record.
Note. When you select Left outer join, you must select the last record that you previously added to the
query. If you attempt to join to records other than the last record, an error message appears.
• If the Enable Auto Join preference is selected on the Query Preference page, click the record name to
join with.
• If the Enable Auto Join preference is not selected on the Query Preference page, click the OK button.
• If the Enable Auto Join preference is selected, the Auto Join Criteria page appears.
You can clear the criteria from the query. You can also click the Add Criteria button to add or edit
criteria or conditions. If no common keys are between the two join records, a message appears instead
of the Add Criteria page.
• If the Enable Auto Join preference is not selected, the Auto Join Criteria page does not appear.
If you want, navigate to the Criteria page to add criteria to the ON clause of the outer join. The This
Criteria Belongs To drop-down list box specifies where the criteria will appear. Select the alias that
corresponds to this join record.
• For 2–3 tier client: If the joined record is an effective-dated record, the Effective Date Criteria page
appears.
• For 4–tier PeopleSoft Pure Internet Architecture: If the joined record is an effective dated record, a
message appears stating that an effective date criteria has been automatically added.
Optionally, you can navigate to the Criteria page to change the defaults for this criteria.
11. To ensure that the left outer join finished successfully, navigate to the Query page.
Text for the joined records confirms a successful left outer join.
120 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 5 Working with Advanced Query Options
12. (Optional) If the query has multiple joins to the same security record, which can be resource intensive and
time consuming when it runs, select the Security Join Optimizer option to improve the performance of
this query.
See Chapter 2, "Creating and Running Simple Queries," Viewing and Editing Query Properties, page 22.
If you use PeopleSoft Query with the DB2 UDB platform, the DB2 UDB platform does not allow you to have
a subquery in the ON clause of a left outer join. For example:
SELECT A.ROLENAME, A.DESCR FROM
(PSROLEUSER B LEFT OUTER JOIN PSOPRDEFN C ON
B.ROLEUSER IN (SELECT F.OPRID FROM
PSOPRDEFN F WHERE F.OPRID IN ('AMA1','AMA2','AMA3')))
This code yields the following error message: "SQL0338N An ON clause associated with a JOIN operator or
in a MERGE statement is not valid."
Note. Use the SELECT DISTINCT operation when you create a left outer join on two records with two
separate security records. Using the SELECT operation in this case will cause the query to pull in too many
records.
PeopleSoft Query automatically includes an OR IS NULL condition to make sure all relevant records are
included.
If you want to create criteria for the left outer joined record, you can add left outer joins criteria into the ON
clause.
1. On the Criteria page (Reporting Tools, Query, Query Manager, Criteria), click the Edit button to access
the Edit Criteria Properties page.
2. On the Edit Criteria Properties page, select ON clause of outer join <Alias Name> from the This Criteria
Belongs To drop-down list box.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 121
Chapter 6
A connected query is a hierarchical object built with existing PeopleSoft queries. A parent query can nest n
levels of child queries and any child query can have m sibling queries within a hierarchy. No artificial limits
exist for n and m, but typical use involves a single parent-child relationship or a few levels of nesting. Fields
in a child query are mapped to related fields in the immediate parent query. A connected query returns a
hierarchical data set in which data returned by child queries is filtered by the results of its immediate parent
query.
Connected queries are used to analyze data, supply to other systems with PeopleSoft data using Web
Services, and create XML Publisher reports that use connected query as a Data Source.
See PeopleTools 8.51 PeopleBook: XML Publisher for PeopleSoft Enterprise, "Creating and Registering Data
Sources" and PeopleTools 8.51 PeopleBook: XML Publisher for PeopleSoft Enterprise, "Running, Locating,
and Viewing XML Publisher Reports."
User create a set of linked simple queries to collect data from multiple tables instead of creating a
complicated query with multiple equal, outer joins, and grouping conditions.
• When two or more SQL statements are linked with left outer join to the same query.
Connected Query enables you to collect data similar to query performing left outer joins. In contrast to
query, Connected Query enables you to link multiple queries to a single parent query.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 123
Using Connected Query Chapter 6
• As a tool in the process of replacing Crystal reports (that use subreports) with XML Publisher reports.
Crystal reports can include the main reports and a set of subreports that could be combined in the same
template. Using Connected Query, you can replace a Crystal reports having main reports and subreports
with XML Publisher reports.
A simple query (including a query with multiple joins) creates a tabular plain layout. To have a
hierarchical output, you need to use multiple grouping conditions that involve complicated logic and is
not always straight forward. Connected Query processing creates a hierarchical output where a single row
of data from parent query results in a set of rows in a child query. This data is processed row by row and
produces structured data. It has similarity with SQR and Application Engine nested loops processing.
Instead of using Application Engine or SQR to collect data for file processing by XML Publisher, use
Connected Query as the data collection tool because no conditional logic involves in this process.
However, use SQR for processes with high volume of data or when high performance is required.
You can quickly create a single parent-child relationship using the Connected Query Quick Start component
(CQ_WIZARD), and create complex connected queries using the Connected Query Manager (PSCONQRS).
Parent Query A parent query in a connected query is a query that has one or many child
queries. The top level query in a connected query is the parent query.
Child Query A child query in a connected query is a query that has a single parent query. A
child query can also serve as a parent query if it has one or more child queries in
the Connected Query definition. A child query can have one or more sibling
queries.
Sibling Query A sibling query in a connected query is a child query that shares a parent with
another child query.
Public Connected Query Public connected query is a query that can be used by all users.
Private Connected Private connected query is a query that can be used only by its creator.
Query
Note. Private connected queries include public queries and private queries that
have been created by the same user.
Mapping Query Fields Mapping query fields establishes the filtering relationship between values of
selected fields in a child query and the corresponding fields in the parent query.
124 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Note. The Help icon is available only in Connected Query Quick Start.
In this example:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 125
Using Connected Query Chapter 6
Query QE_EMPLOYEE displays detailed information of every employee that is selected by query
QE_EMPLOYEE_FROM_PERSDATA_TREE.
• The last query (QE_DEPARTMENT_DATA) displays detailed information of each department that
participated in the report.
126 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Note. The parent and child queries must exist and be visible in Query Manager before you can use them to
create a connected query.
Connected Query Quick Start is used only for creating new connected queries. You can edit existing
connected queries using the Connected Query Manager page.
Connected query uses query security permissions for each of it member queries.
See Also
Chapter 2, "Creating and Running Simple Queries," Creating New Queries, page 10
Chapter 6, "Using Connected Query," Understanding Connected Query Manager, page 136
Connected Query Quick CQ_WZ_INFO Reporting Tools, Connected Enter a connected query
Start - Enter a Name and Query, Connected Query name and descriptive
Descriptive Information Quick Start information, and define
ownership of the connected
query.
Connected Query Quick CQ_WZ_PARENT Reporting Tools, Connected Select an existing query to
Start - Select a Parent Query Query, Connected Query use as the parent query.
Quick Start
Enter a connected query and
descriptive information, and
click the Next button.
Connected Query Quick CQ_WZ_CHILDQRY Reporting Tools, Connected Select an existing query to
Start - Select a Child Query Query, Connected Query use as the child query.
Quick Start
Enter a connected query and
descriptive information, and
click the Next button.
Select an existing query to
use as the parent query, and
click the Next button.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 127
Using Connected Query Chapter 6
Connected Query Quick CQ_WZ_FLDMAP Reporting Tools, Connected Map query fields from a
Start - Map Child Query Query, Connected Query child query to
Fields to Parent Query for Quick Start corresponding fields from a
Filtering parent query.
Enter a connected query and
descriptive information, and
click the Next button.
Select an existing query to
use as the parent query, and
click the Next button.
Select an existing query to
use as the child query, and
click the Next button.
Connected Query Quick CQ_WZ_PREVIEW Reporting Tools, Connected Enable report developers to
Start - Preview Query, Connected Query review a new connected
Quick Start query and preview the
results by running it in a
Enter a connected query and
preview mode with a
descriptive information, and
limited number of rows
click the Next button.
returned from each query.
Select an existing query to
use as the parent query, and
click the Next button.
Select an existing query to
use as the child query, and
click the Next button.
Map query fields from a
child query to
corresponding fields from a
parent query, and click the
Next button.
This is an example of the Connected Query Quick Start - Enter a Name and Descriptive Information page:
128 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Connected Query Quick Start - Enter a Name and Descriptive Information page
Note. The name of the connected query cannot be changed after you enter the
name into the Select a Child Query page of a Connected Query Quick Start.
Because Connected Query uses node name as an XML node, query names used
in a Connected Query must follow these naming rules:
• Query names can include letters, numbers, and other characters.
• Query names can start with letters xml (or XML,Xml, and so on).
If a query name starts with an alpha or underscore [ _ ] character, the query node
name in an XML file will be the same as the query name. Otherwise, the query
node name will be the query name with the prefix PS_. For example:
• Query MyQuery123 is written to the output XML file as MyQuery123.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 129
Using Connected Query Chapter 6
Note. The ownership of the connected query cannot be changed after you enter
data into the Select a Child Query page of a Connected Query Quick Start.
Next Note. The Next button is available after you enter the name of the connected
query in the Connected Query field and move to any other field.
2. Enter a connected query and descriptive information, and click the Next button.
The Connected Query Quick Start - Select a Parent Query page appears.
This is an example of the Connected Query Quick Start - Select a Parent Query page:
130 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Parent Query Click the query Lookup icon to select a parent query from a list of queries for
which you have been granted access.
Note. You must use the query Lookup icon to select a parent query and be able to
move to the next page.
View Query Click to open Query Manager component in read-only mode to view the query.
Next Note. This button becomes active after you select a parent query.
2. Enter a connected query and descriptive information, and click the Next button.
3. Select an existing query to use as the parent query, and click the Next button.
The Connected Query Quick Start - Select a Child Query page appears.
This is an example of the Connected Query Quick Start - Select a Child Query page:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 131
Using Connected Query Chapter 6
Child Query Click the query Lookup icon to select a child query from a list of queries for
which you have been granted access.
After you select a child query, its name appears in the Connected Query Structure
section.
View Query This button becomes active after you select a child query.
Click to open Query Manager component in read-only mode to view the query.
Next Note. This button becomes active after you select a child query using the lookup
icon.
2. Enter a connected query and descriptive information, and click the Next button.
3. Select an existing query to use as the parent query, and click the Next button.
132 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
4. Select an existing query to use as the child query, and click the Next button.
The Connected Query Quick Start - Map Child Query Fields to Parent Query for Filtering page appears.
This is an example of the Connected Query Quick Start - Map Child Query Fields to Parent Query for
Filtering page:
Connected Query Quick Start - Map Child Query Fields to Parent Query for Filtering page
This page displays two sets of fields coming from parent and child queries:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 133
Using Connected Query Chapter 6
• The parent query section displays parent query fields and is for informational purposes only.
This section is collapsed by default and you have the option to expand it.
• The child query section displays child query fields and enables the report developer to select one or more
fields for mapping.
For each child query field selection, a drop-down list box with possible parent query field lists appears.
Those parent query field lists are filtered by compatible field data types. In some cases, Connected Query
Manager uses smart thinking to map fields based on partial matching names but ultimate field matching is
up to the user.
If parent and child queries are not linked with some fields, each row of data for a parent query will have all
rows from a child query as no filtering from a parent to child will happen. For example, Project is a parent
query and Project Description is a child query. The Project and Project Description queries are linked by the
Project_ID field that will assume one-to-one relationship (assuming no EFFDT field exists in a second
query). Therefore, if the Project query returns 100 rows, the Project Description query will return a single row
for the Project query, and resulted data set will have 100 rows of data.
If no field is selected as a mapped field (Project_ID field), Connected Query returns 100 x 100 = 10000 rows.
Sometimes mapped fields are not needed , in which case the system displays a warning message when you
save the connected query (Connected Query design time).
Note. The Fields column in the Connected Query Structure section displays the
values that you just selected.
Next Note. This button becomes active after you select the fields for mapping and
click the Map Fields button.
2. Enter a connected query and descriptive information, and click the Next button.
3. Select an existing query to use as the parent query, and click the Next button.
4. Select an existing query to use as the child query, and click the Next button.
5. Map query fields from a child query to corresponding fields from a parent query, and click the Next
button.
134 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Preview XML Click to display the formatted XML output for this connected query.
XML output appears in a Preview mode, in the lower section of the Preview
page.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 135
Using Connected Query Chapter 6
Max Rows Fetched For Enter the maximum number of rows to display in Preview mode.
Query
Note. You should limit the number of rows that are being fetched. The default
value is 6. If you enter 0 or clear this text box, no row limits will be imposed for
a resulting XML, which can cause significant delay in getting results; and
because the application runs in synchronized mode using the application server,
you may get browser time-out or tuxedo time-out.
Complete Click to transfer to Connected Query Manager page, where you can perform
enhancements and save the connected query.
Note. While working with a Connected Query Quick Start, you can modify your
previous selections at any step by clicking the step number (in yellow or gray)
icons. Changes in your selection could change a connection query structure.
Note. In the Connected Query Quick Start - Preview page, when XML that contains CDATA sections is
displayed at runtime, application users will see <![CDATA* and *]> in places of <![CDATA[ and ]]>.
• Preview XML
• Run to window
• Schedule
Note. Currently, Connected Query Manager supports only XML output format.
Connected Query structure consists of a set of PeopleSoft queries that are linked by related fields. No limits
exist for the number of fields being linked between two queries.
136 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Note. Parent and child pairs of queries can be linked together using sets of correlated fields, though those
linkages are not required.
Each query being selected in a connected query structure has a set of image icons, which enables you to
perform various actions:
Note. While deciding which tool to use for reporting purposes, report developer should consider using a
single query with joins and unions first. Using Connected Query could affect the performance of the reporting
application.
The main contributing factor to the Connected Query performance is the number of nested levels. Application
developer should try to minimize the depth of nesting in a Connected Query structure. Another contributing
factor is the number of rows being returned from each query. To achieve a better performance, queries that
are positioned higher in a Connected Query hierarchy should be limited in the number of rows being returned.
This limitation could be achieved by means of using filtering in parent queries.
See Also
PeopleTools 8.51 PeopleBook: PeopleSoft Application Designer Developer's Guide, "Working With
Projects"
Connected Query Manager - PSCONQRSSRCH Reporting Tools, Connected Edit a connected query,
Search Query, Connected Query copy an existing connected
Manager query, delete a connected
query, preview results of a
connected query, schedule a
connected query to run
immediately with results
displayed in a separate
window, and schedule a
connected query to run at
the preset time.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 137
Using Connected Query Chapter 6
Connected Query Manager PSCONQRSBUILDER Reporting Tools, Connected Create and maintain
Query, Connected Query connected queries.
Manager
Click the Edit link.
Connected Query Properties PSCONQRSPROP Reporting Tools, Connected Used by Report developers
Query, Connected Query to associate a set of
Manager properties with a connected
query definition, modify
Click the Edit link.
values of execution or
On the Connected Query output XML file based on
Manager page, click the user-selected properties, and
Properties button. ensure that user-selected
properties (with
PeopleTools projects) are
compatible with
PeopleTools 8.50 and later
releases.
Copy a Connected Query PSCONQRSCOPY Reporting Tools, Connected Copy a connected query.
Query, Connected Query
Manager
Click the Copy link for the
connected query to copy.
Connected Query Viewer PSCONQRSSRCH Reporting Tools, Connected View the results of a
Query, Connected Query running connected query:
Viewer preview the XML, schedule
a connected query to run
immediately with results
displayed in a separate
window, or schedule the
connected query to run at a
later time.
138 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Public Indicate the query ownership. Select to indicate that this is a public query. Clear
this check box to indicate that this is a private query.
Note. Public connected queries can be run by any user with adequate
permissions. Private connected queries can be run and edited only by the owner.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 139
Using Connected Query Chapter 6
Any connected query with an In Progress status can be previewed, but not
scheduled.
• Inactive: Indicates a connected query that does not pass a validation routine.
Parent Query Selection Click the search icon to select a parent query from an existing list.
Note. You must use the search icon to search for and select a parent query. After
you select a parent query, all buttons become active and the Connected Query
Structure section appears with active icons, which enables you to continue
building a connected query.
View Query Click to open the selected query in read-only mode in the Query Manager
component.
Query Manager opened from Connected Query is fully functional but does not
allow you to save any changes.
Connected Query Note. This section appears after you select a parent query.
Structure
Displays the image icons that you can use to further develop the Connected
Query structure.
Preview XML Note. This button becomes active after you select a parent query.
Save Note. The Save button becomes active after you select a parent query.
You can save the connected query as soon as you have added one parent query.
140 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 141
Using Connected Query Chapter 6
Note. You define all connected query properties as strings using the name-value pairs concept. These
properties are stored in database-managed tables as a part of the connected query definition.
You can preview a connected query XML without storing its properties in the database.
Effective date operator is available in the Connected Query Manager page as a part of the field mapping
process. You can select an effective date operator for any of the member queries if a child query has an
EFFDT value selected as a related field.
This example shows the Connected Query Manager page and the Eff Date Operator (effective date operator)
list:
142 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Example of the Connected Query Manager page and the Eff Date Operator list
• Is available in the Connected Query Manager but not available in the Connected Query Quick Start.
• Need not be saved in the database before you preview the XML of a connected query.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 143
Using Connected Query Chapter 6
The connected query name must be unique to all private and public queries.
By default, the Public check box is selected to indicate that this connected query is a public connected
query. You can clear the Public check box if you want this connected query to be private .
5. Select the status of the connected query using the Status drop-down list box.
Note. The Inactive status indicates that a connected query does not pass a validation routine. When a
connected query is not valid, this status is set automatically during the Save process.
• Select the Active option to enable the user to schedule a connected query.
• Select the In Progress option to indicate that this query can be previewed in Connected Query
Manager, but can not be scheduled.
The In Progress status is useful when a connected query is not ready for end user to view using the
Connected Query Viewer page.
6. Optionally, enter description and comments for the connected query using the Description and Comments
fields.
If the Description field is blank, Connected Query populates the description using the connected query
name.
7. In the Parent Query field, click the search icon to select a parent query from an existing list.
Note. You must use the search icon to search for and select a parent query. After you select a parent
query, all buttons become active and the Connected Query Structure section appears with active icons,
which enables you to continue building a connected query.
8. Optionally, click the View Query button to view the selected query.
Note. You can preview a connected query at any point without having previously saved it.
9. Optionally, continue building your connected query by adding child queries, linking fields between parent
and child queries, and so on.
Because connected query can be created with one parent query presented, you can save your connected
query and use it as a new connected query.
144 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
1. Access the Connected Query Manager page by selecting Reporting Tools, Connected Query, Connected
Query Manager.
3. In the Connected Query Manager search page, click the Edit link on the row with the connected query you
want to edit.
4. Optionally, change the connected query structure, edit description fields, and change the connected query
status.
1. Access the Copy Connected Query page by selecting Reporting Tools, Connected Query, Connected
Query Manager.
3. On the Connected Query Manager page, click the Copy link next to the connected query to copy.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 145
Using Connected Query Chapter 6
1. Change the connected query name in the Target section with a new unique name.
1. Access the Connected Query Manager page by selecting Reporting Tools, Connected Query, Connected
Query Manager.
A confirmation message appears asking if you want to delete the existing connected query.
146 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Alternatively, click the Cancel button to cancel the deletion and return to the Connected Query Manager
page.
This is an example of the message received when you open a PeopleSoft query in the Connected Query
Manager:
Sample message received when you open a PeopleSoft query in the Connected Query Manager
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 147
Using Connected Query Chapter 6
You can access the Connected Query Viewer page by selecting Reporting Tools, Connected Query,
Connected Query Viewer.
Search Click to search for a connected query using the basic search function.
Combined with only the begins with condition, the basic search enables you to
select the following Search by criteria: Connected Query Description, Connected
Query Name, Connected Query Status, and Owner.
Advanced Search Click the Advanced Search link to search for a connected query using the
advanced search function.
The advanced search enables you to perform a narrower search by using one or
more Search by criteria and selections of conditions for each Search by criterion.
You can select the following Search by criteria: Connected Query name,
Description, Status, Ownership Type, and Case Sensitive Search.
Preview - Max Rows For Enter a number of rows to be returned from each query in a preview mode.
Query You should limit the number of rows that are being returned. The default value is
6. If you enter 0 or clear this text box, no row limits will be imposed for a
resulted XML, which can cause a significant delay in getting results; and because
the application runs in a synchronized mode using application server, you may
get browser time-out or tuxedo time-out errors.
148 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Preview XML Click a Preview XML link for the selected connected query to view its results in
a new browser window.
Note. The Preview XML action uses the Application Server to generate and
configure XML data, thus you have to wait for XML data to be available. To
keep working while system generates and configures XML data, use the Run to
Window link, which does not limit number of rows returned from each query.
If the connected query has prompts, a prompt window appears after you click the
Preview XML button.
Run to Windows Click a Run To Windows link for the selected connected query to schedule that
query to be run immediately using PeopleSoft Process Scheduler, and then view
its XML results in a new browser window.
Schedule From the Connected Query Viewer search results page, click the Schedule link
that is associated with the connected query.
Connected Query Viewer interacts with PeopleSoft Process Scheduler to enable
you to schedule connected queries. You can submit requests to schedule a
connected query, check the status of your request using Process Monitor, and
view connected query results using Report Manager.
See PeopleTools 8.51 PeopleBook: PeopleSoft Process Scheduler, "Using
Process Monitor" and PeopleTools 8.51 PeopleBook: PeopleSoft Process
Scheduler, "Using Report Manager."
See Also
PeopleTools 8.51 PeopleBook: XML Publisher for PeopleSoft Enterprise, "Running, Locating, and Viewing
XML Publisher Reports," Running XML Publisher PeopleSoft Query Reports
• Clicking the Run To Window link in the Connected Query Manager search page or the Connected Query
Viewer search page.
• Clicking the Schedule link in the Connected Query Manager search page or the Connected Query Viewer
search page.
Connected Query interacts with Application Engine program PSCONQRS to enable you to schedule
connected queries. You can search for an existing run control ID or create a new run control ID and
schedule a connected query using the Schedule Connected Query page, check the status of your request
using the Process Monitor link, and view your output using the Report Manager link.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 149
Using Connected Query Chapter 6
Report Manager Click to access the Report Manager page to view the report content after the
output file is posted and the output destination is set to Web or Window.
The final output file is posted to the Report Manager repository for web access
by authorized users.
See PeopleTools 8.51 PeopleBook: PeopleSoft Process Scheduler, "Using Report
Manager."
Process Monitor Click to access the Process Monitor page and check the progress of your request.
See PeopleTools 8.51 PeopleBook: PeopleSoft Process Scheduler, "Using
Process Monitor."
Update Parameters Click to update the runtime prompt values of connected query.
See PeopleTools 8.51 PeopleBook: PeopleSoft Process Scheduler, "Submitting
and Scheduling Process Requests."
Run Click to access the Process Scheduler Request page, where you can specify
variables, such as where a process runs and in what format the process output is
generated. The values for output type and output format appear by default per the
report definition and can be changed if the report definition allows it.
Note. The Run button in the Schedule Connected Query page functions as the
Schedule link in the Connected Query Manager search page.
150 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Chapter 6 Using Connected Query
Note. On the Schedule Connected Query page, you cannot modify the connected
query name after you save the Run Control ID.
See Also
PeopleTools 8.51 PeopleBook: PeopleSoft Process Scheduler, "Getting Started With PeopleSoft Process
Scheduler"
PeopleTools 8.51 PeopleBook: XML Publisher for PeopleSoft Enterprise, "Running, Locating, and Viewing
XML Publisher Reports"
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 151
Appendix A
Because these queries are run by the system rather than by users, the PeopleSoft application does not run the
same prequery security checks. In particular, the application does not check which access groups the user who
is running a workflow query can access—because the user is a workflow agent. (For this reason, you may not
want to allow all users to create workflow queries.)
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 153
Creating Workflow Queries Appendix A
Query Properties page with the Security Join Optimizer option selected
Note. You should use a naming convention to distinguish the different types of queries.
The Role query option refers to the fact that role queries are named with names that begin with [ROLE].
See Also
Chapter 2, "Creating and Running Simple Queries," Understanding Query Types, page 5
154 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Appendix B
Using PeopleSoft Query Access Manager, you can create, view, and update query access group trees.
Query access group trees contain two types of nodes: groups and records.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 155
PeopleSoft Query Security Appendix B
Use the Query Access Manager page to create query trees or search for existing query trees.
PeopleSoft provides sample trees with all of its applications. You can configure these trees; however, because
these trees may get replaced when you upgrade to subsequent application releases, you should create your
own query trees based on your organization's needs.
In your query trees, include all record components that you want users to be able to query. Note that you do
not have to put all record components in the same query tree. Instead, you can use the sample query trees to
provide access to the standard PeopleSoft record definitions, but create additional query trees for record
definitions that you want to add while adapting your system. This strategy enables you to take advantage of
the sample trees but avoid overwriting your changes during future application upgrades.
How you organize the contents of your query trees depends on the needs of your organization and users. For
example, for nontechnical or casual users, you might want to create small trees that are not intimidating.
156 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Appendix B PeopleSoft Query Security
To simplify the trees, you can create separate trees that contain subcategories of each function. For example,
you could create separate trees for human resources, general ledger, and projects record components so that
users in each region can access only those record components that they use.
When creating your tree, you should also have an access group that includes all components of the tree. This
enables you to give users access to all tables more easily—you need only to add one row on the Access
Groups tab in Query Security.
Note. Consider adding record components to your query trees in a hierarchy that matches the parent/child
relationship of records in your database. Although you do not have to organize records in this way—
PeopleSoft Application Designer actually controls the parent/child hierarchy in your database—you will
probably find it helpful to keep your query trees consistent with your database structure.
To create new queries, or even to run existing ones, users must have access rights to the record components
that are used in the queries. After you have built your query trees, you must grant users access to them. You
can grant and restrict access to entire query trees or portions of them through the Permission List Access
Groups page (by selecting PeopleTools, Security, Permission & Roles, Permission Lists, Query, Access
Group Permissions).
See Also
PeopleTools 8.51 PeopleBook: Security Administration, "Setting Up Permission Lists," Setting Query
Permissions
This example shows the Query Access List Cache page (RUN_QRYACCLIST) :
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 157
PeopleSoft Query Security Appendix B
Note. When the Enable Access List Cache option is selected and roles of a user Profile or permission list of a
role has been modified, which affect the Query Access List Cache, you must rerun the QRYACCLIST AE
process to properly update the cache. Otherwise, the Query Access List Cache is not up-to-date and will be
switched off automatically.
Rerun the process when changes have been made to Query Access Groups or Query Access Group settings on
Roles or Permission Lists.
158 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Appendix B PeopleSoft Query Security
Row-level security enables users to access a table without accessing all rows on that table. This type of
security is typically applied to tables that hold sensitive data. For example, you might want users to be able to
review personal data for employees in their own departments but not for employees in other departments. To
accomplish this, you would give everyone access to the PERSONAL_DATA table, but would enforce row-
level security so that users could see only the rows where the DEPTID matches their own.
Note. PeopleSoft Query row-level security is enforced only when you are using PeopleSoft Query or
Scheduled Query; it doesn't control runtime page access to table data.
PeopleSoft applications implement row-level security by using a query security record (typically a view) that
is specified on the record definition that joins the data table with an authorization table. When a user searches
for data in the data table, the system performs a related record join between the security record view and the
base table (rather than searching the table directly). The view adds a security check to the search, based on the
criteria that you have set up for row-level security. For example, to restrict users to seeing only data from
their own departments, the view would select from the underlying table only those rows where the DEPTID
matches the user's DEPTID. You can specify the query security record by selecting an appropriate view from
the Query Security Record drop-down list box on the Record Properties dialog box for any record definition.
This is an example of the Record Properties dialog box with Query Security Record is set to
QE_PERS_SRCH:
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 159
PeopleSoft Query Security Appendix B
Note. Process and role queries override the automatic row-level query security logic that is applied to all
other types of queries. For this reason, you should restrict access to creating these types of queries to
administrative types of roles and not include any sensitive data columns in the select list for these types of
queries. You can restrict access to creating and modifying these queries based on query profile settings that
are assigned to a permission list. Note that Workflow queries also override the row-level security logic.
To secure data through the query security record view, create a query security record that has both of the
following criteria:
• The same key field as the base record that you are securing.
160 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Appendix B PeopleSoft Query Security
• One of the following three row-level security fields as a key field and not as a list box item:
When you add one of the preceding fields as a key field, Enterprise PeopleTools automatically adds a
WHERE clause when it does a select through the record. This forces the value to be equal to the current user's
value.
Query security record definitions serve the same purpose as search record definitions do for pages. Just as a
search record definition determines what data the user can display in the page, the query security record
definition determines what data the user can display with PeopleSoft Query.
To get PeopleSoft Query to retrieve data by joining a security record definition to the base table, specify the
appropriate query security record when you create the base table's record definition.
Note. The PeopleSoft row-level security views restrict users from seeing certain rows of data. If you specify a
query security record for a given base record definition, PeopleSoft Query adds a qualifier to the WHERE
clause of each query, instructing the system to retrieve only rows in organizational entities to which you have
been granted access. If you perform a historical query—for example, a query asking for the employees in
your department as of last year—you may not get the results that you expect. Because the system is enforcing
row-level security, PeopleSoft Query returns only those employees who were in the department last year and
who are currently in a department to which you have access.
Each PeopleSoft product line comes with a set of views for implementing its standard row-level security
options.
This example shows the Security - Query Profile page (SCRTY_QUERY_PROF) (PeopleTools, Security,
Permissions and Roles, Permission Lists, Query tab):
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 161
PeopleSoft Query Security Appendix B
Query profiles specify the type of access that users have when they work with PeopleSoft Query. For
example, you may want certain users to run only existing queries, not create new ones. You might also want
to restrict the types of queries that users can create, limit the number of rows returned, or set the time that a
query can run before it times out.
Note. If a user has more than one permission list, PeopleSoft Query uses the highest time-out value as defined
in the Time-out Minutes section of the user's permission lists.
When you select the Allow creation of Role, Process and Archive Queries check box, you also allow the user
to create role, process, and archive queries.
See Appendix C, "Query Administration," Understanding Query Administration, page 165 and PeopleTools
8.51 PeopleBook: Security Administration, "Setting Up Permission Lists," Setting General Permissions.
You can also determine the output options that users have for generating their queries. The first level of
security is access to PeopleSoft Query itself. If you don't give users access to PeopleSoft Query when you
define their user IDs, they can't create or run queries. Not all users needs to create their own queries.
162 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Appendix B PeopleSoft Query Security
PeopleSoft tests query profile settings across all of the permission lists to which a user has access. For
example, each permission list that is granted to a user or role has the possibility to add capabilities. However,
the Only Allowed to Run Queries option is unique because when you select this option, capabilities are
removed. So if you want to prevent users from updating queries (and allow them only to run them), then you
must ensure that none of the permission list settings grant the update capabilities by clearing the Only
Allowed to Run Queries option.
By default, the query profile gives users access to all PeopleSoft Query features—assuming, of course, that
you gave them access to PeopleSoft Query.
See Also
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 163
Appendix C
Query Administration
This appendix provides an overview of Query Administration and discusses how to use Query
Administration.
Note. Workflow queries are excluded from the statistics because of the large volume that can be run as part of
workflow processing. Therefore, you should take care that workflow queries are as efficient as possible.
Query Administration also enables you to cancel queries that are currently running in Query Manager and
Query Viewer as well as enable and disable queries and logging.
See Also
• Administer queries.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 165
Query Administration Appendix C
Administering Queries
Access the Admin page (PeopleTools, Utilities, Administration, Query Administration).
Admin page
To administer queries:
166 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Appendix C Query Administration
1. Use either the predefined search or manual search option to restrict the list of queries that are displayed.
For a predefined search, enter the desired value for the selected search option in the (n)= field and select
one of the following options:
• Queries that have run but not in the last (n) days.
For a manual search, select to search queries by query name or owner ID.
You can define your search further by selecting either begins with or contains search type.
2. Click the Search button to display a list of queries that match your search criteria.
The Query List group box lists those queries that match your search criteria.
• Owner ID.
• Query name.
• Folder.
• Logging status.
• Disabled status.
Note. If a query appears in the list as <UNTITLED>, a user has created and run one or more queries
without saving them. Results from all unsaved queries appear as a single untitled row. You can clear
statistics only for untitled queries. Attempting to perform any other action on untitled queries will
result in an error message.
4. For the appropriate query, click the View Log link to view the log for that query.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 167
Query Administration Appendix C
5. For the appropriate query, click the View SQL link to view the SQL for that query.
6. Select the check box for each query on which you want to perform an action.
You can also click the Check All button to select all queries, or click the Uncheck All button to clear all
queries.
When you enable the logging feature, detailed statistics will be logged on the query after every time it
has run to completion. The statistics are stored in a separate Query Log table.
Note. The statistics log is updated with data only if the query runs to completion.
• Disable: Disables the selected query from being run, previewed, or scheduled.
• Clears Stats/Logs: Delete the statistics and logs for the selected query.
8. For the appropriate query, click the Logging button to enable logging for that query.
168 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Appendix C Query Administration
Executing page
The Executing page displays all of the currently running queries, allowing you to enable or disable queries,
enable or disable logging, and cancel currently running queries. If an administrator needs to verify that a
query has been canceled, he or she can look in the Appsrv.log and verify that the PSMONITORSRV service
has canceled the selected query.
1. Use either the predefined search or manual search option to restrict the list of queries that are displayed.
2. In the (n)= field, enter the value that you want for the search option.
For a manual search, select to search queries by query name or owner ID.
You can define your search further by selecting either the begins with or contains search type.
3. Click the Search button to display a list of queries that match your search criteria.
The Query List group box lists those queries that match your search criteria.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 169
Query Administration Appendix C
• User ID.
• Owner ID.
• Query name.
• Domain ID.
• Process identifier.
• Host.
• Machine name.
• Status.
• Time started.
• Logging status.
• Disabled status.
5. For the appropriate query, click the View Log link to view the log for that query.
6. For the appropriate query, click the View SQL link to view the SQL for that query.
7. Select the check box for each query on which you want to perform an action.
You can also click the Check All button to select all queries, or click the Uncheck All button to clear all
queries.
When you enable logging, detailed statistics are logged on the query after every time it has run to
completion. The statistics are stored in a separate Query Log table.
• Disable: Disables the selected query from being run, previewed, or scheduled.
9. For the appropriate query, select the Logging check box to enable logging for that query.
170 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Appendix C Query Administration
The kill (cancel) query/time-out mechanism represents each query that is run from Query Manager or Query
Viewer as a row in the table PSQRYTRANS. Query Monitor, which implements the kill query/time-out
functionality, has a mechanism that looks for orphan rows in PSQRYTRANS. Orphan rows are rows in
PSQRYTRANS that do not have a query actively running. Orphan rows can be created because the server
crashed while running a query, or other reasons.
Query Monitor looks for orphan rows only for the application server domain that it is running in. For this
reason, orphan rows could be in PSQRYTRANS when no active domain exists. These rows are not seen by
the online query monitoring facility, but could potentially exist in the database. Such rows are rare, and you
can use the database query tool to clean them up. You can use the machine and domain fields to determine
whether rows exist that should be cleaned up.
Settings page
Enable Query Timeout Select or clear this check box to enable or disable the query time-out feature on a
system-wide basis. The time-out values are stored in each permission list.
Note. The query time-out feature applies to queries that are run in Query
Manager and Query Viewer. This feature does not apply to scheduled queries.
Run Query Statistics Select or clear this check box to enable or disable the query statistics feature on a
system-wide basis.
By default, the query statistics feature is disabled.
PeopleSoft recommends that you use the query statistics feature only for analysis,
and that you do not leave it enabled on an ongoing basis. Enabling this feature
may compromise the performance and the system may have an increased
possibility of query time-outs or may return query results with zero values. This
recommendation also applies to users of queries in reports.
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 171
Index
overview 123
A quick start 126
security 126
action 97 steps used to create a connected query 144
add prompt 48 terms 124
Admin page 166 connected query, quick start
advanced searching overview 126
for queries 29 connected query manager
for records 15 opening a PeopleSoft query 147
aggregate 21 overview 136
aggregate functions 111 Connected Query Quick Start
applying to a field 112 step 1: Enter a Name and Descriptive
average 112 Information 128
count 112 Step 2: Select a Parent Query 130
max 112 Step 3: Select a Child Query 131
min 112 Step 4: Map Child Query Fields to Parent
sum 112 Query for Filtering 132
understanding 111 Step 5: Preview a Connected Query 134
alias 16 connected query scheduler
AND operator 54 using 149
any record joins 117 connected query viewer
Application Engine using 148
See PeopleSoft Application Engine Constant (comparison value) 44, 46
Appsrv.log 169 Content Reference 78
archive queries 7 Content Reference Link 78
attachment url Copying a Connected Query 145
link 85 copying SQL 25
Auto Preview count (aggregate function) 112
enabling and disabling 26 Creating a Connected Query 139
average (aggregate function) 112 criteria
AND/OR operators in 54
based on a field 41
choosing 37
B comparison values in 43
condition types in 41
batch processes, creating 6 defining 38
between (condition type) 42 effective date 52
browser, downloading to 32 entering 39
business processes 2 grouping 54
HAVING 59
relating multiple 53
Criteria page 39
C crystal reports 6
CSV, downloading to 30
cube manager 2
Character (expression type) 61 Current Date (comparison value) 45
column and sort order, defining 19
column headings, choosing 21
column number 21
column order 20
comparison values 43, 49, 51
D
component url
link 76 DB2 UDB restrictions 121
component url widget 75 defaults
condition type 52 for criteria 52
condition types 41 for filenames of queries 31
connected query Deleting a Connected Query 146
connected query manager 136 dirty read 8
copying 145 overview 8
creating 139 disabling Auto Preview 26
deleting 146 Display and Select TreeNodes page 50
editing 145 Distinct check box 24
example 125 distribution
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 173
Index
E G
edit criteria properties greater than (condition type) 42
page 39 grouping criteria 54
Edit Criteria Properties page 39 groups, granting access to 157
Edit Field Ordering page 19
Edit Field Properties page 12, 20
Editing a Connected Query 145
Edit List page 47 H
Edit Prompt Properties page 57
edit type 58 HAVING criteria 59
EFFDT field 52 heading text 19, 58
effective date criteria 52 heading type 58
Effective Seq (comparison value) 45 heading type, choosing 58
effective sequence 52 hierarchy join 16
Email (output type) 103 HTML, downloading to 30
Enable Auto Join 117
Enable Auto Preview 26
equal to (condition type) 42
Excel
applying formulas to 32
I
defining regional settings for 32
downloading to 26, 30 In List (comparison value)
modifying file type options for 32 building a list for 47
understanding restrictions with queries 31 understanding 45
Executing page 166, 168 in list (condition type) 42
exists (condition type) 42 instance 107
Expression (comparison value) 44 Internet Explorer menu, adding queries to 30
expression lists in tree (condition type) 42
adding comparison values to 49 is null (condition type) 42
adding prompts to 48
expression properties 60
viewing and editing 66
expressions
J
creating lists of 48
creating with aggregate functions 112 joins
defining 59 any record 117
understanding 59 hierarchy 16
using MetaSQL in 61 left outer 119
expressions page 60, 66 outer 118
external url record hierarchy 116
link 82 related record 116
external url widget 81, 84
174 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Index
overview 1
K PeopleSoft Workflow 7
permission lists 161
keys, prompting for 58 Printer (output type) 103
printing queries 34
private queries, defining 23
Process List page 105
L Process Monitor 105
process name 102
language, specifying for user 108 process queries 6
Left Outer Join process requests
Security Join Optimizer 24 filtering 105
left outer joins monitoring 105
creating 119 scheduling 101
understanding restrictions for DB2 UDB 121 selecting output formats for 104
less than (condition type) 42 selecting output types for 103
like (condition type) 43 submitting 99
list, building and editing a 47 Process Scheduler
list cache 157 See PeopleSoft Process Scheduler
list members 47 process type 102
logs prompt
Appsrv.log 169 runtime 49
deleting 168 Prompt (comparison value) 44
enabling and disabling 168 prompts
viewing 167 adding to expression lists 48
lookups, performing 33 defining 56
performing lookups for 33
understanding 56
understanding reasons for 6
M PS/nVision
report 2
PS/nVision queries 7
max (aggregate function) 112 PSMONITORSRV service 169
MetaSQL, using in expressions 61 public queries, defining 23
min (aggregate function) 112
monitoring process requests 105
multiple queries, running 28
My Favorite Queries list 108 Q
queries
N adding to Favorites list 30
adding to My Favorite Queries list 108
advanced options for 111
naming a query 23 aggregate functions in 111
new name 96 AND/OR operators in 54
nodes See tree nodes archive 7
Number (expression type) 61 assigning a new owner for 168
nVision queries See PS/nVision queries cancelling 169
copying to another user 109
creating 5, 10
O creating unions of 114
default filenames of 31
defining as private or public 23
ON clause 121 defining criteria in 37
operators 54 deleting 96
orphan rows, deleting 171 deleting logs for 168
outer joins 118 deleting orphan rows in 171
output types downloading 30
understanding 103 editing properties of 22
eliminating duplicate rows in 24
enabling disabling time-out 171
P entering a description for 23
finding existing 93
formatting output 19
parenthesis, using 54 modifying 93
PeopleSoft Application Engine 6 moving to a folder 109
PeopleSoft Process Scheduler 99 naming 23
peoplesoft query organizing 108
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 175
Index
176 Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved.
Index
T
timeout, enabling and disabling 171
translate values 19
translating fields 21
tree nodes, selecting 50
Tree Option (comparison value) 45
tree prompt
define a criteria 51
Tree Prompt 100
Tree Prompt Option (comparison value) 45
Tree Prompts 101
U
unions 114
unique field name 21
untitled queries 167
Update Tree Parameters 101
use as criteria 9
user queries 5
Using Connected Query Scheduler 149
using connected query viewer 148
V
View SQL page 12, 24
W
Web (output type) 103
WEBLIB_QUERY 26
WHERE clause, replacement for 59
Window (output type) 104
Workflow See PeopleSoft Workflow
workflow queries 7, 153, 165
defining 153
X
XML
downloading to 26
XML Publisher
data sources 2, 6, 30, 100
view query report 35, 107
Copyright © 1988, 2010, Oracle and/or its affiliates. All Rights Reserved. 177