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 inrowsRows to enrich
STRING idcellnameName of the cell containing the id (eg WRD_ID, ID, ROWKEY). Append '[]' if the cell is an array of values.
TABLE tblTable to enrich with
RECORD addcolumnsOutput columns to add
RECORD optionsOptions
RECORD leftouterjoinDefault values to insert for left side missing matches, instead of deleting them from the result
BOOLEAN rightouterjoinInsert default values for missing matches, instead of deleting them from the result
RECORD wrapfieldsIf 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 ARRAYThe enriched records, in their original order. Any records which could not be enriched, are removed from the output array