ch.attach()

Read(134) Label: channel, attach an operation,

Description:

Attach an operation to a channel.

Syntax:

ch.attach(…)

Note:

The function attaches an operation to channel ch. The sign ~ used in the expression parameter … represents the result of the previous operation performed in the channel.

Parameters:

ch

Channel

An expression of performing an operation over a sequence

Return value:

Channel

Example:

 

A

 

1

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

2

=channel()

Create a channel

3

=A2.select(SALARY>10000)

Attach a ch.select() operation to the channel

4

=A2.attach(~.sort(-SALARY))

Attach a A.sort() operation to the channel

5

=A2.fetch()

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

6

=A1.push(A2)

Push the data in A1’s sequence into the channel

7

=A2.result()

Get the result of the last operation performed in the channel