cs.push()

Read(468) Label: cursor, channel,

Description:

Push data in a cursor into a channel.

Syntax:

cs.push(chi ,…)

Note:

The function pushes data in cursor cs into channel chi, but the action needs to wait until the data in the cursor is fetched; then returns the cursor itself. The function supports multicursors.

Parameters:

cs

Cursor

chi

Channel

Return value:

Cursor

Example:

 

A

 

1

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

Create a cursor

2

=channel()

Create a channel

3

=channel()

Create a channel

4

=A2.groups(SELLERID:SellerId;sum(AMOUNT):Total)

Perform ch.groups() operation in the channel

5

=A3.select(ORDERID<10)

Attach ch.select() operation to A3’s channel

6

=A3.fetch()

Fetch and store the existing data in the channel

7

=A1.push(A2,A3)

Be ready to push data in A1’s cursor into the channel, but the action needs to wait

8

=A1.groups(SELLERID:SellerId;sum(AMOUNT):Total)

Data in A1’s cursor is pushed into the channel as the data retrieval operation begins

9

=A2.result()

Get results from A2’s channel

10

=A3.result()

Get results from A3’s channel

 

 

A

 

1

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

Create a cursor

2

=channel()

Create a channel

3

=A2.select(ORDERID>100)

Attach ch.select() operation to the channel

4

=A2.fetch()

Keep data in the channel

5

=A1.push(A2)

Be ready to push A1’s cursor data to the channel

6

=A1.fetch()

Fetch data from A1 cursor when the cursor data is really pushed into the channel and the operations in the channel are executed

7

=A2.result()

Fetch the final result set from the channel

Related functions:

ch.push()

A.push()

channel()