Q: How do I link tables with queries?
A: If the master table is also a query you can use this code for it:
select * from customer
The detail table has a couple of things to do. First, you need a couple lines of code.
select * from orders
where custNo = :custNo
The :custNo part will refer back to whatever the dataSource points to.
It should be pointing to the dataSource that points to the master table.
In this way, the values are passed in as a parameter.