You are on page 1of 28

Section 1: Foundations

Module 6: Query Operations

1
Module Objectives
After completing this module, you will be able to:
Run, refine and save a query
Cancel long running queries
Use public (predefined) queries
Use the Find command

Why you need to know


When dealing with a large database, you need to know how to locate and
work with smaller sets of data

2
What Is a Query?
A query retrieves information from a database,
allowing you to
Locate one or more records that meet specified
criteria
Create a subset of data for viewing and reporting
Refresh the view to see updated information

Siebel eBusiness applications support Query by


Example (QBE)
QBE helps you quickly and easily find the
information you are looking for

3
How to Run a Query
Follow these steps:

1. Determine Query Criteria

2. Create New Query

3.Define Query Criteria

4. Execute Query

5. Review Result Set

4
1. Determine Query Criteria
Before you query, decide what data you are looking for
Example: Find all accounts with Site = HQ, State = California, and
Account Type = Commercial

5
2. Create New Query
There are three ways to create a new query

Select New Query


from Query menu

Click New Query icon

Type Ctrl-Q on keyboard

6
3. Define Query Criteria
Enter criteria in the appropriate fields
One or more conditions may be entered per field
Case sensitivity applies to queries and is set in the configuration file

Enter fields in list applet

Use provided options,


such as in pick list

Enter fields in form applet

7
4. Execute Query
There are three ways to execute a query

Click the Execute Query icon

Select Execute Query from


Query menu

Press Enter

The active applet will display the set of records that meet the
criteria

8
5. Review Result Set
Records matching your query criteria are displayed

9
Multi-Value Field Applet (MVF)
An MVF applet allows the display of multiple values for a single field

Multiple addresses for an account

Multiple positions on a team

1
Querying a MVF Applet
When a field has multiple values, you may use the query operator
EXISTS( )

EXISTS(San Francisco)

1
Querying a MVF Applet With EXISTS
EXISTS (San Francisco) returns all accounts with at least one
address city = San Francisco

Barracuda has two account


addresses, one in Berkeley
and one in San Francisco

1
Querying a MVF Applet Without EXISTS
Querying without EXISTS (City = San Francisco) returns all
accounts with address city = San Francisco
Gorman Engineering has
two account addresses in
San Francisco

1
Querying a Team MVF
Querying with EXISTS(VSILVER)
Record will return if VSILVER exists on the team

Querying VSILVER without EXISTS( )


Record will return only if VSILVER is the primary on the team

1
Sorting Data Returned by a Query
Sorts are done in list applets and can be saved as part of a query
Single column sorts can be done from the toolbar

Click on the column to


be sorted...

then click on the icon

1
Sorting Data Returned by a Query Continued
Multiple columns can also be sorted
Select Sort Order from View menu...

or Right-click on a field and


choose Sort Order

1
Refining a Query
Use Refine Query to modify an existing query
Refine an existing query to narrow the search by adding more conditions
or change conditions already entered
Select Query Refine Query from the menu, or type Ctrl-R

Add or delete criteria in list applet

or form applet

Any unmodified criteria will remain

1
Saving a Query
You can save your query for future use

Enter a descriptive
Select Save name for your
Query As from query
the Query
Menu

When screen is refreshed, queries appear in alphabetical order

1
Canceling a Query
If your query is running too long, you may cancel it
Enable query cancel in View Options

Enable query Define the


cancellation time to wait for
query
completion

Dialog will
display if query
run time exceeds
Click to cancel query
wait times

1
Deleting a Query
You may delete queries that you have created

Select the query to


delete and click
OK

Select Delete
Query from the
Query Menu

2
Predefined Queries
Are controlled by the System Administrator
Are specific to the current screen
Determine the records displayed in many views
Encompass the most common needs of the company and users
Can only be deleted by the System Administrator

Appear in the
Queries
picklist

2
Controlling Predefined Queries
Select Application Administration Predefined Queries
All queries created appear in this view

Unlock a query
to allow access
to all users
Object you are querying
Name of the query
appears here
displays here

Key SQL syntax appears


here and may be
manually updated

2
Additional Query Operators
<= (Less than or equal to) can be used on numeric or date fields
<> (Not equal to) can be used on all fields
OR allows entry of more than one value for a field
Wildcards (*) can be used to search for multiple characters
Ma* will find Madrid, but not San Mateo
*Ma* will find Madrid and San Mateo
* cannot be used in date or numeric fields

A full list of Query


Operators can be found
in Help

2
Querying Tips
The use of wildcards can affect the speed of the query
Example: Using *S will check every record in the table
Plan and strategize before you run a query to improve performance
and produce more usable results
Which are the most unique values that you can search?
Depending on which fields you query, your query may take a while
due to excessively broad criteria

2
Using the Find Command
Find allows you to query a business entity from anywhere within the
UI
Can be configured to only query on particular business entities, and
then only on specific fields within those entities

2
Summary
This module showed you how to:
Create, refine, and save a query
Sort data returned by a query
Cancel a long running query
Control predefined queries
Use the Find command

2
Labs
Lab 1
Basic Querying
Lab 2
Advanced Querying
Lab 3
Applying Your Querying Skills

2
Lab Review
Review observations, comments, and issues that arose during the lab
Discuss the solutions to the questions asked

You might also like