ROW

ROW( { fields } , recstruct )

ROW( row , resultrec )

ROW( [ row , ] transform )

fieldsA comma-delimited list of data values for each field in the recstruct, contained in curly braces ( {} ).
recstructThe name of the RECORD structure defining the field layout.
rowA single row of data. This may be an existing record, or formatted in-line data values like the fields parameter description above, or an empty set ( [ ] ) to add a cleared record in the format of the resultrec. If omitted, the record is produced by the transform function.
resultrecA RECORD structure that defines how to construct the row of data, similar to the type used by TABLE.
transformA TRANSFORM function that defines how to construct the row of data.
Return:ROW returns a single record.

The ROW function creates a single data record and is valid for use in any expression where a single record is valid.

ROW Form 1

The first form constructs a record from the in-line data in the fields, structured as defined by the recstruct. This is typically used within a TRANSFORM structure as the expression defining the output for a child dataset field.

Example:

AkaRec := {STRING20 forename,STRING20 surname};
outputRec := RECORD
  UNSIGNED id;
  DATASET(AkaRec) kids;
END;
inputRec := {UNSIGNED id,STRING20 forename,STRING20 surname};
inPeople := DATASET([{1,'Kevin','Halligan'},{1,'Kevin','Hall'},
                     {2,'Eliza','Hall'},{2,'Beth','Took'}],inputRec);
outputRec makeFatRecord(inputRec L) := TRANSFORM
  SELF.id := l.id;
  SELF.kids := DATASET([{ L.forename, L.surname }],AkaRec);
END;
fatIn := PROJECT(inPeople, makeFatRecord(LEFT));
outputRec makeChildren(outputRec L, outputRec R) := TRANSFORM
  SELF.id := L.id;
  SELF.kids := L.kids + ROW({R.kids[1].forename,R.kids[1].surname},AkaRec);
END;
r := ROLLUP(fatIn, id, makeChildren(LEFT, RIGHT));