vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | declare function samecust($cust, $ord) |
| 2 | {$cust.cid = $ord.cid} |
| 3 | |
| 4 | for $c in recordset(['cid', 'int32', 'name', 'string', 'age', 'int32'], 'osfiles', ['nc1', 'data/spj01/cust1.adm'], ['nc2', 'data/spj01/cust2.adm']) |
| 5 | for $o in recordset(['oid', 'int32', 'date', 'int32', 'cid', 'int32', 'total', 'float'], 'osfiles', ['nc1', 'data/spj01/ord1.adm'], ['nc2', 'data/spj01/ord2.adm']) |
| 6 | where samecust($c, $o) |
| 7 | limit 2 |
| 8 | return { "custname":$c.name, "orddate":$o.date } |
| 9 | |