T.derive( A/cs,x:C,…;wi,… )

Read(308) Label: key value, cluster, field-adding,

Description:

Add fields of a cluster composite table to a cluster memory table /cluster cursor according to the latter’s key values.

Syntax:

T.derive(A/cs,x:C,…;wi,...)

Note:

The function adds one or more fields of cluster composite table T to cluster memory table A or cluster cursor/multicursor cs according to key values of the latter.

Parameters:

T

A composite table

A/cs

A cluster memory table /cluster cursor/cluster multicursor

x

Field value

C

Column alias

wi

Filtering condition; separate multiple conditions, which should be met at the same time, by comma(s)

Return value:

A cluster cursor

Example:

 

A

 

1

=file("emp1.ctx",["192.168.0.118:8281"])

 

2

=A1.open()

Open a cluster table

3

=file("emp2.ctx",["192.168.0.151:8281"]).open().memory()

Return a cluster memory table

4

=A2.derive(A3,DEPT,SALARY).fetch()

Add fields of the cluster composite table to A3’s cluster memory table by the latter’s key values

5

=file("emp2.ctx",["192.168.0.151:8281"]).open().cursor()

 

6

=A2.derive(A5,DEPT,SALARY).fetch()

Add fields of the cluster composite table to A5’s cluster cursor by the latter’s key values