Relational features in Woda work on the same server or across several servers using HTTP. This is what you can do:
&QRY($table, $search, $then, $sort, $format, $first, $max);
&FLD($table, $id, $fieldName);
&ROWS(table,flds,search,then,sort,format,first,max);
Most of these function expect a reference to another table as a parameter. If the application is cgi-bin/people with data in somewhere/people and the other application is cgi-bin/other with data in somewhere/data you do not need to do anything. Just call the other table 'other'. If, however, the other table is somewhere else on the same server or even on another server somewhere on the Internet, then a setting $WBB{'tables'} must be defined. [More information].
Suppose we have two tables - a table of professors and a table of classes. Each professor teaches 0 or more classes. In the definition of the classes table, we would include a field that would point to the class's professor like this:
$x='professor'; # ------------------------------ $WBF{$x,srt}=$i--; $WBF{$x,'p'} = 'Professor teaching this class'; $WBF{$x} = '1;'; $WBF{$x,'type'} = 'LINKOPTION'; $WBF{$x,'into'} = 'professors'; $WBF{$x,'picture'} = '"<a href=/cgi/professors?$_>$_</a>"';
in the above example only the id code of the professors record will appear in the pulldown. If we modify the above into field as:
$WBF{$x,'into'} = '&ROWS("professors","_id,firstName,lastName")';
the pulldown will include first and last name of the professor.
If we further improve the picture field as:
$WBF{$x,'picture'} = ' $xx = &FLD(professors,$_,lastName) . " " .&FLD(professors,$_,firstName; "<a href=/cgi/professors?$_>$xx</a>" ';
the fist and last name of the professor will also be nicely printed in the tabular output form.
Finally, in the professors record, we might like to see a list of classes he/she teaches:
$x='classes'; # ------------------------------ $WBF{$x,srt}=$i--; $WBF{$x} = '1;'; $WBF{$x,'type'} = 'COMPUTE'; $WBF{$x,'picture'} = '"<a href=$SCRIPT/Search?search=$rec{_id}>Classes he/she teaches</a>"';
The above only displays a link to a query. The below modification displays the actual records:
$WBF{$x,'picture'} = '&QRY(“classes”,"+professor:$rec{\_id}");';
The above approach may not be too smooth, but it works. The &RELATED, &DECODE and &LINK functions make this even simpler.