08/31/18 For a Better Future 1
QQ and Advance
Query
DMS basic building blocks.
08/31/18 For a Better Future 2
Introduction
 To understand how QQ and
Advance Query works in DMS.
 Kai Leung Liu, Sr. Oracle Architect
Consultant, Kaitech, Inc.
08/31/18 For a Better Future 3
Topics of Discussion
 What is Quick Query?
 What is Quick Query made of?
 What is Advanced Query?
 What is Advanced Query
made of?
 How to Implement?
08/31/18 For a Better Future 4
What is Quick Query?
 Quick Query is a basic component
used in forms.
 The Quick Query is used on most
common fields in a given form.
 Quick Query is a standard option in
all our standard forms
development.
 User knows it as the flashlight
button.
08/31/18 For a Better Future 5
What is Quick Query
Made of?
 The components has several parts
are:
 Packages: CMN_SQL_PKG
 PL/SQL Library:
CMN_L_TOOLBAR.pll
 Forms Program Unit:
DEV_TLBR_QUERY_RECORD_P
RE
 Used in all DMS forms for Quick
Query.
08/31/18 For a Better Future 6
What is Advanced
Query?
 A separate window interface build to
support more advanced criteria option for
user to selected.
 The advanced query window has three
areas:
 Query parameters – users enter filter
information for the advanced query.
 Order result by - users can select the
columns that the query will be ordered by.
Maximum of 5.
 Results – Contains the result set.
08/31/18 For a Better Future 7
What is Advanced Query
made of?
 The components has several parts
are:
 Packages: CMN_SQL_PKG
 PL/SQL Library:
CMN_L_TOOLBAR.pll
 Forms store procedure:
CMN_BLOCK_QUERY_(<Name>)
 Examples: Donor, Event, and B&C
Advanced Query.
08/31/18 For a Better Future 8
How to Implement?
 Perform program validation of input fields
 Call VALIDATE_ITEM
 Initialize SQL creation field
 CMN_SQL_PKG. INIT_SQL_STMT_FIELDS
 Build where statement
 CMN_SQL_PKG.WHERE_STMT
 Build order by (if needed)
 CMN_SQL_PKG.CREATE_ORDER_BY
 Retrieve global fields into local variables
 CMN_SQL_PKG. RETR_SQL_STMT_FIELDS
 Append to query block (When finished)
 Execute query (When finished)
08/31/18 For a Better Future 9
Build Where Statements
 The CMN_SQL_PKG.WHERE_STMT creates
where clause based on column name and
operator passed in.
 IF input value is passed in then continue on.
 Build the constructor operator (AND or OR)
 Build where clause based on operator passed
in. Valid operators are:
 ‘LIKE’-(varchar2 only), '=','<>','!
=','>','>=','<','<=', BETWEEN,an IN. Note : IN
clause needs data passed in following way
(value1,value2,value3…).
08/31/18 For a Better Future 10
Additional Operators
 SUB-QUERY – supports <column>
IN (<SQL>).
 ADD_LINE – Allow you to add you
own SQL line.
 EXISTS
 NOT EXISTS
 HAVING
08/31/18 For a Better Future 11
Real Life
 We used Quick Query in most form
development.
 It a basic building block for other
DMS modules like criteria,
advanced query, reporting, and
etc.
 Quick Query is a core
infrastructure piece for now and
the future.
08/31/18 For a Better Future 12
What This Means
 Quick Query should be used when
your building SQL statement in the
development process.
 Quick Query to key to a modular
approach to build SQL statement
now and future rewrite.
08/31/18 For a Better Future 13
Next Steps
 Review Tech docs for Advanced
Query, Form Query, and SQL
Build.
 Answer questions?
 Next Lecture is Batch Reporting?

QQ and Advance query

  • 1.
    08/31/18 For aBetter Future 1 QQ and Advance Query DMS basic building blocks.
  • 2.
    08/31/18 For aBetter Future 2 Introduction  To understand how QQ and Advance Query works in DMS.  Kai Leung Liu, Sr. Oracle Architect Consultant, Kaitech, Inc.
  • 3.
    08/31/18 For aBetter Future 3 Topics of Discussion  What is Quick Query?  What is Quick Query made of?  What is Advanced Query?  What is Advanced Query made of?  How to Implement?
  • 4.
    08/31/18 For aBetter Future 4 What is Quick Query?  Quick Query is a basic component used in forms.  The Quick Query is used on most common fields in a given form.  Quick Query is a standard option in all our standard forms development.  User knows it as the flashlight button.
  • 5.
    08/31/18 For aBetter Future 5 What is Quick Query Made of?  The components has several parts are:  Packages: CMN_SQL_PKG  PL/SQL Library: CMN_L_TOOLBAR.pll  Forms Program Unit: DEV_TLBR_QUERY_RECORD_P RE  Used in all DMS forms for Quick Query.
  • 6.
    08/31/18 For aBetter Future 6 What is Advanced Query?  A separate window interface build to support more advanced criteria option for user to selected.  The advanced query window has three areas:  Query parameters – users enter filter information for the advanced query.  Order result by - users can select the columns that the query will be ordered by. Maximum of 5.  Results – Contains the result set.
  • 7.
    08/31/18 For aBetter Future 7 What is Advanced Query made of?  The components has several parts are:  Packages: CMN_SQL_PKG  PL/SQL Library: CMN_L_TOOLBAR.pll  Forms store procedure: CMN_BLOCK_QUERY_(<Name>)  Examples: Donor, Event, and B&C Advanced Query.
  • 8.
    08/31/18 For aBetter Future 8 How to Implement?  Perform program validation of input fields  Call VALIDATE_ITEM  Initialize SQL creation field  CMN_SQL_PKG. INIT_SQL_STMT_FIELDS  Build where statement  CMN_SQL_PKG.WHERE_STMT  Build order by (if needed)  CMN_SQL_PKG.CREATE_ORDER_BY  Retrieve global fields into local variables  CMN_SQL_PKG. RETR_SQL_STMT_FIELDS  Append to query block (When finished)  Execute query (When finished)
  • 9.
    08/31/18 For aBetter Future 9 Build Where Statements  The CMN_SQL_PKG.WHERE_STMT creates where clause based on column name and operator passed in.  IF input value is passed in then continue on.  Build the constructor operator (AND or OR)  Build where clause based on operator passed in. Valid operators are:  ‘LIKE’-(varchar2 only), '=','<>','! =','>','>=','<','<=', BETWEEN,an IN. Note : IN clause needs data passed in following way (value1,value2,value3…).
  • 10.
    08/31/18 For aBetter Future 10 Additional Operators  SUB-QUERY – supports <column> IN (<SQL>).  ADD_LINE – Allow you to add you own SQL line.  EXISTS  NOT EXISTS  HAVING
  • 11.
    08/31/18 For aBetter Future 11 Real Life  We used Quick Query in most form development.  It a basic building block for other DMS modules like criteria, advanced query, reporting, and etc.  Quick Query is a core infrastructure piece for now and the future.
  • 12.
    08/31/18 For aBetter Future 12 What This Means  Quick Query should be used when your building SQL statement in the development process.  Quick Query to key to a modular approach to build SQL statement now and future rewrite.
  • 13.
    08/31/18 For aBetter Future 13 Next Steps  Review Tech docs for Advanced Query, Form Query, and SQL Build.  Answer questions?  Next Lecture is Batch Reporting?