![background image](http://html1.mh-extra.com/html/omron/cx-supervisor-v2-0/cx-supervisor-v2-0_user-manual_744213237.webp)
CHAPTER 12 – Databases
OMRON
Page 214
Release 2.0
Compound Relation Hierarchy example:
This sample illustrates a three-level hierarchy of customers, orders, and order details:
SHAPE {SELECT * from customers}
APPEND ((SHAPE {select * from orders}
APPEND ({select * from [order details]} AS rsDetails
RELATE orderid TO orderid)) AS rsOrders
RELATE customerid TO customerid)
In addition to the Simple Relation Hierarchy example, the Order ID is now used to create a recordset
containing the order details for the shown order.
Hierarchy with Aggregate example:
SHAPE (select * from orders}
APPEND ({select od.orderid, od.UnitPrice * od.quantity as
ExtendedPrice
from [order details] As od}
RELATE orderid TO orderid) As rsDetails,
SUM(ExtendedPrice) AS OrderTotal
This example creates a Recordset of all the orders and their details, and adds a field called
ExtendedPrice to store the total order value for each record, and sums all the ExtendedPrice values
which is stored in Order Total.
Group Hierarchy example:
SHAPE {select customers.customerid AS cust_id, orders.*
from customers inner join orders on customers.customerid =
orders.customerid} AS rsOrders
COMPUTE rsOrders BY cust_id
Group Hierarchy with Aggregate example:
SHAPE
(SHAPE {select customers.*, orders.orderid, orders.orderdate from
customers inner join orders on customers.customerid =
orders.customerid}
APPEND ({select od.orderid,
od.unitprice * od.quantity as ExtendedPrice from [order details]
as od} AS rsDetails
RELATE orderid TO orderid),
Summary of Contents for CX-SUPERVISOR - V2.0
Page 2: ...CX Supervisor User Manual Software Release 2 0...
Page 3: ......
Page 5: ...CX Supervisor User Manual OMRON Page ii Revision 2 0...
Page 7: ...CX Supervisor User Manual OMRON Page iv Revision 2 0...
Page 11: ...CX Supervisor User Manual OMRON Page viii Revision 2 0...
Page 13: ...CX Supervisor User Manual OMRON Page x Revision 2 0...
Page 15: ...CX Supervisor User Manual OMRON Page xii Revision 2 0...
Page 17: ...CX Supervisor User Manual OMRON Page xiv Revision 2 0...
Page 19: ...CX Supervisor User Manual OMRON Page xvi Revision 2 0...
Page 21: ...CX Supervisor User Manual OMRON Page xviii Revision 2 0...
Page 23: ......
Page 67: ......
Page 97: ......
Page 137: ...CHAPTER 7 Graphics Library OMRON Page 114 Release 2 0...
Page 183: ...CHAPTER 9 Animation OMRON Page 160 Release 2 0...
Page 215: ......
Page 263: ......
Page 269: ......
Page 274: ...OMRON CHAPTER 16 Connecting to Omron Industrial Components Release 2 0 Page 251...
Page 275: ......
Page 285: ......
Page 319: ......
Page 331: ......
Page 351: ......
Page 359: ...GLOSSARY OF TERMS CX Supervisor User Manual OMRON Page 336 Release 2 0...