ch.fetch()

Read(923) Label: channel, result set generation,

Description:

Fetch and store the existing data in a channel.

Syntax:

ch.fetch(f)

Note:

The function fetches and stores the existing data in channel ch; write result of data retrieval to bin file f when parameter f is present. It is a result set generation function.

Parameter:

ch

Channel

f

A bin file

Return value:

Channel

Example:

 

A

 

1

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

 

2

=channel()

Create a channel.

3

=channel()

 

4

=A2.select(ORDERID>100)

Attach ch.select() operation to the channel.

5

=A3.select(ORDERID>100)

 

6

=A2.fetch()

Attach ch.fetch() function that returns the final result to A2’s channel while retaining the exisitng data in the channel.

7

=A3.fetch("sales.btx")

Attach ch.fetch() function that gets the final result set to A3’s channel, and define writing result to bin file sales.btx in the main directory.

8

=A1.push(A2,A3)

Push A1’s data in into the channel.

9

=A1.fetch()

 

10

=A2.result()

Get the result of performing the operation from the channel.