How the Persons Tree View Was Defined |
The second tab page of the Travel Agency Catalog illustrates these features: •Single Tree View Node with several Child Nodes. •Use of hard-coded names such as Persons, Customers and Staff in a tree view. •An indication of the number of Scheduled Tours a customer participated in. To define the Persons tree view:
Tree View Node 2 Tree View Node 3 Tree View Node 4 For Tree View Node 2, set Child Nodes to Tree View Node 5. For Tree View Node 3, set Child Nodes to Tree View Node 7. For Tree View Node 4, set Child Nodes to Tree View Node 8. For Tree View Node 5, set Child Nodes to Tree View Node 6.
SELECT DISTINCT 'Person' FROM person
SELECT DISTINCT 'Customer' FROM person
SELECT DISTINCT 'Guide' FROM guide
SELECT DISTINCT 'Staff' FROM staff
SELECT DISTINCT SUBSTR(family_name,1,1) first_char FROM person WHERE guide = 'N' AND staff = 'N'
SELECT p.family_name||', '|| p.first_name|| ' ('||COUNT(pt.person_id)||')' FROM person p ,participant pt WHERE SUBSTR(p.family_name,1,1)=:FIRST_CHAR AND p.person_id = pt.person_id(+) AND p.guide = 'N' AND p.staff = 'N' GROUP BY p.family_name,p.first_name
•You can concatenate columns in a SELECT statement to display more than one column in a tree view. •You can refer to an alias name (:first_char) used in the SQL Query of the parent tree view node. •You can use outer joins for showing the customers that did not participate in any scheduled tour.
SELECT family_name||', '||first_name FROM guide
SELECT family_name||', '||first_name FROM staff
ac-rel(*Page 2, set-workarea, Tree View 1) |