QQ And Advance Query

744 views
684 views

Published on

Overview of Query and Adv Query Componements

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
744
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

QQ And Advance Query

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

×