blob: 6630507f85150cad79ba81930190345be92be752 [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001use dataverse demo0927;
2
3declare type CustomerType as closed {
4 cid: int32,
5 name: string,
6 age: int32?,
7 address: AddressType?,
8 lastorder: {
9 oid: int32,
10 total: float
11 }
12}
13
14declare type AddressType as closed {
15 number: int32,
16 street: string,
17 city: string
18}
19
20
21declare type OrderType as closed {
22 oid: int32,
23 cid: int32,
24 orderstatus: string,
25 orderpriority: string,
26 clerk: string,
27 total: float
28}
29
30declare nodegroup group1 on nc1, nc2;
31
32declare dataset Customers(CustomerType)
ramangrover29669d8f62013-02-11 06:03:32 +000033 primary key cid on group1;
vinayakb38b7ca42012-03-05 05:44:15 +000034declare dataset Orders(OrderType)
ramangrover29669d8f62013-02-11 06:03:32 +000035 primary key oid on group1;
vinayakb38b7ca42012-03-05 05:44:15 +000036
37write output to nc1:"/tmp/custorder.adm";
38
39for $c in dataset('Customers')
40for $o in dataset('Orders')
41where $c.cid = $o.cid
42return {"cust":$c.name, "ordertot":$o.total}