Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Oracle Forms: Record Groups

4,738 views

Published on

Oracle Forms: Record Groups

Published in: Software
  • Be the first to comment

Oracle Forms: Record Groups

  1. 1. Working With Record Groups http://ebiztechnics.blogspot.com
  2. 2. Objectives • Describe the record group object • Use record groups • Define record groups at design time • Control record groups by using built-in functions • Define query record groups programmatically • Define nonquery record groups programmatically • Manipulate record group rows • Define lists of values (LOVs) programmatically • Manipulate list items programmatically • Implement dynamic list items • Add values to combo boxes http://ebiztechnics.blogspot.com
  3. 3. Types of Record Groups Query Non Query Static  Based on a SELECT Statement  Design Time  Run Time  Not Based on a SELECT Statement  Run Time  Not Based on a SELECT Statement  Design Time http://ebiztechnics.blogspot.com
  4. 4. Record Groups and LOVs Record groups and LOVs • Forms implicitly creates query record groups. • Use SET_LOV_PROPERTY to replace default record group. ... IF Get_LOV_Property(lov_id,GROUP_NAME) ='GROUP1' THEN Set_LOV_Property(lov_id,GROUP_NAME,'GROUP2'); END IF; ... http://ebiztechnics.blogspot.com
  5. 5. Uses of Record Groups • Constructing dynamic Queries • Storing form-configuration information • Communicating within a form • Passing data to other forms • Passing data to other Oracle products – Reports – Graphics • Populating or storing list items • Populating Hierarchical Tree items http://ebiztechnics.blogspot.com
  6. 6. Defining Record Groups at Design Time http://ebiztechnics.blogspot.com
  7. 7. Creating and Deleting Record Groups CREATE_GROUP CREATE_GROUP_FROM_QUERY Record group ID Record group ID ID Name DELETE_GROUP Name, QueryName http://ebiztechnics.blogspot.com
  8. 8. Modifying the Structure ADD_GROUP_ROW DELETE_GROUP_ROW Row No ID Dname Loc 1 10 Accounting 2 3 20 Sales 4 30 Finance ADD_GROUP_COLUMN SET_GROUP_CHAR_CELL GET_GROUP_NUMBER_CELL http://ebiztechnics.blogspot.com
  9. 9. Populating Query Record Groups POPULATE_GROUP (_WITH_QUERY) SELECT deptno ID, dname FROM dept ID 10 20 30 40 Dname ACCOUNTING SALES FINANCE OPERATIONS http://ebiztechnics.blogspot.com
  10. 10. Processing Record Group Rows GET_GROUP_SELECTION_COUNT SET_GROUP_SELECTION GET_GROUP_SELECTION Selection No Row No 1 1 2 3 2 4 ID Name 1 James 2 King 3 Allen 4 Smith GET_GROUP_ROW_COUNT http://ebiztechnics.blogspot.com
  11. 11. Defining Query Record Groups Programmatically Find Record Group ID NULL ? Create Group from Query Populate Group Yes No http://ebiztechnics.blogspot.com
  12. 12. Defining Nonquery Record Groups Programmatically Find Record Group ID NULL ? Create Group Yes No Add Group Columns Add Group Row Set Group Cell Values Delete Group Rows Find Group Columns http://ebiztechnics.blogspot.com
  13. 13. Manipulating Record Groups Get number of group rows For all group rows Cell value= given value Yes No Return row number Return NULL http://ebiztechnics.blogspot.com
  14. 14. Manipulating Selected Record Group Rows For all group rows Get number of group rows Row number even? Yes No Mark row as selected http://ebiztechnics.blogspot.com
  15. 15. Defining Global Record Groups • Record group visible to all forms in an application • “Scope” parameter – FORM_SCOPE (default) – GLOBAL_SCOPE ...CREATE_GROUP(‘emp_rg’, GLOBAL_SCOPE’); ...CREATE_GROUP_FROM_QUERY(‘emp_rg’, ‘SELECT empno FROM emp’, ‘GLOBAL_SCOPE’); http://ebiztechnics.blogspot.com
  16. 16. Manipulating List Items Programmatically • ADD_LIST_ELEMENT • DELETE_LIST_ELEMENT • CLEAR_LIST • GET_LIST_ELEMENT_LABEL • GET_LIST_ELEMENT_VALUE • GET_LIST_ELEMENT_COUNT • POPULATE_LIST • RETRIEVE_LIST http://ebiztechnics.blogspot.com
  17. 17. Using List Item with Record Groups Record Group POPULATE_LIST RETRIEVE_LIST http://ebiztechnics.blogspot.com
  18. 18. Implementing Dynamic List Items Find record group Yes ID NULL? No Create group from query Populate group Yes Success? No Populate list Display first list label http://ebiztechnics.blogspot.com
  19. 19. Adding Values to Combo Boxes Get number of list elements For all list elements Element value= Item value? Yes No Return Add list element with item value http://ebiztechnics.blogspot.com
  20. 20. Summary • Define design-time query and static record groups • Define run time query and non-query record groups • Use Built-in functions for populating record groups • Define Global record groups • Use record groups for: – Constructing dynamic SELECT statements – Storing or passing data – Populating or storing list items • Manipulate list items programmatically – Built-in functions for list items http://ebiztechnics.blogspot.com

×