ch.select(x,ch’ )

Description:

Send records in a channel that can’t meet the given condition into another channel.

Syntax:

ch.select(x,ch’)

Note:

The function calculates expression x against each of the records in channel ch, and sends those records over which the value of x is false into channel ch’.

Parameter:

ch

Channel

x

A Boolean expression

ch’

Channel

Return value:

Channel

Example:

 

A

 

1

=demo.cursor("select EID,NAME,SALARY from EMPLOYEE " )

 

2

=channel()

Create a channel.

3

=channel()

Create a channel.

4

=A1.push(A2)

Push data in A1’s cursor into A2’s channel.

5

=A2.select(EID<5,A3)

Push records in A2’s channel that can’t meet the condition EID<5 into A3’s channel.

6

=A2.fetch()

Attach ch.fetch() function that gets the final result set to A2’s channel to fetch and store the existing data in A2’s channel.

7

=A3.fetch()

Attach ch.fetch() function that gets the final result set to A3’s channel to fetch and store the existing data in A3’s channel.

8

=A1.skip()

It is when fetching data from A1’s cursor begins that data in the cursor is truly pushed to the channel and computations start.

9

=A2.result()

Get result of the computation in channel A2.

10

=A3.result()

Get result of the computation in channel A3.