ch. select()

Read(951) Label: select, original channel,

Description:

Attach a record filtering computation to a channel and return the orignal channel.

Syntax:

ch.select(x)

Note:

The function attaches a computation to channel ch, which will calculate expression x on each of its records and get records that make values of x true, and returns the original channel ch.

 

When parameter x is absent, get all records.

 

This is an attachment function.

Parameter:

ch

A channel

x

Boolean expression

Return value:

Channel

Example:

 

A

 

1

=demo.cursor("select * from SALES")

 

2

=channel()

Create a channel.

3

=A2.select(ORDERID>100)

Attach a computation to A2’s channel, which will get records meeting the condition ORDERID>100, and return the original channel.

4

=A2.fetch()

Fetch and keep the current data in the channel.

5

=A1.push(A2)

Be ready to push data in A1’s cursor to A2’s channel.

6

=A1.fetch()

Fetch data from cursor A1 while pushing data to channel A2 to execute the attached computation and keep the result.

7

=A2.result()

Get result from the channel.