EnrichWithTable (open)
Enrich an array with fields from a database table
Syntax
LOADLIB "wh::dbase/dynquery.whlib";
RECORD ARRAY FUNCTION EnrichWithTable(RECORD ARRAY inrows, STRING idcellname, TABLE tbl, RECORD addcolumns, RECORD options)
Parameters
RECORD ARRAY inrows
Rows to enrich
STRING idcellname
Name of the cell containing the id (eg WRD_ID, ID, ROWKEY). Append '[]' if the cell is an array of values.
TABLE tbl
Table to enrich with
RECORD addcolumns
Output columns to add
RECORD options
Options
RECORD leftouterjoin
Default values to insert for left side missing matches, instead of deleting them from the result
BOOLEAN rightouterjoin
Insert default values for missing matches, instead of deleting them from the result
RECORD wrapfields
If not empty, wrap the enriched fields in a cell with this name (when the idcell is an array, insert enriched values into this cell).
Return value
RECORD ARRAY
The enriched records, in their original order. Any records which could not be enriched, are removed from the output array