r.derive()

Read(133) Label: record, add, fields,

Description:

Add fields to a record.

Syntax:

r.derive(xi:Fi,…)

Note:

The function adds Fi,… fields to record r, assigns xi to Fi, and returns a new record consisting of the original fields and the new fields.

Parameter:

Fi

Field names, which should not be namesake with the existing fields of record r

xi

Expressions, whose values are used as field values

r

A record

Return value:

Record

Example:

 

A

 

1

=demo.query("select top 9 class,studentid,subject,score from scores")

Return a table sequence:

2

=A1(1)

Return the 1st record of table sequence A1:

3

=A2.derive("MARY":NAME,"F":gender)

Add new fields NAME and gender to A2’s record and return the new record: