declare function samecust($cust, $ord) | |
{$cust.cid = $ord.cid} | |
for $c in recordset(['cid', 'int32', 'name', 'string', 'age', 'int32'], 'osfiles', ['nc1', 'data/spj01/cust1.adm'], ['nc2', 'data/spj01/cust2.adm']) | |
for $o in recordset(['oid', 'int32', 'date', 'int32', 'cid', 'int32', 'total', 'float'], 'osfiles', ['nc1', 'data/spj01/ord1.adm'], ['nc2', 'data/spj01/ord2.adm']) | |
where samecust($c, $o) | |
limit 2 | |
return { "custname":$c.name, "orddate":$o.date } | |