channel()

Read(300) Label: channel,

  Here’s how to use channel() function.

channel()

Description:

Create a channel.

Syntax:

channel()

Create a channel

Note:

The function creates a channel.

Return value:

A channel

Example:

 

A

 

1

=demo.cursor("select * from SCORES where CLASS = 'Class one'")

 

2

=channel()

Create a channel

3

>A2.select(STUDENTID==1)

 

4

>A2.fetch()

 

5

=A1.push(A2)

Push data in A1’s cursor to A2’s channel

6

=A1.fetch()

 

7

=A2.result()

channel(cs)

Description:

Create a channel and push data in a specified cursor into it.

Syntax:

channel(cs)

 

Note:

The function creates a channel, pushes data in cursor cs into it, and returns a channel. This is equivalent to cs.push(channel()).

Parameters:

cs

A cursor

Return value:

A channel

Example:

 

A

 

1

=demo.cursor("select * from SCORES where CLASS = 'Class one'")

 

2

=channel(A1)

Create a channel  and be ready to push data in A1’s cursor into the new channel, which is equivalent to =A1.push(channel()), and return a channel

3

>A2.select(STUDENTID==1)

 

4

>A2.fetch()

 

5

=A1.fetch()

 

6

=A2.result()

channel(cs)

Description:

Create a cluster channel and push data in a specified cluster cursor into it.

Syntax:

channel(cs)

 

Note:

The function creates a cluster channel as synchronously segmented as cluster cursor cs, pushes data in cs into it, and returns a cluster channel.

Parameters:

cs

A cluster cursor

Return value:

A cluster channel

Example:

 

A

 

1

=file@n("E:/emp1.ctx","192.168.0.119:8281")

 

2

=A1.create()

Open a cluster table

3

=A2.attach(table1)

Retrieve cluster entity table table1

4

=A3.cursor()

Return a cluster cursor

5

=channel(A4)

Create a channel, be ready to push data in the cluster cursor into the new channel, and return a cluster channel

6

=A5.fetch()

Keep data of the cluster channel

7

=A4.fetch()

 

8

=A5.result()

Get data from the cluster channel

 

channel(ch)

Description:

Create a channel and push data in another channel into it.

Syntax:

channel(ch)

 

Note:

The function creates a channel, pushes data in channel ch into it, and returns a channel. This is equivalent to ch.push(channel()).

Parameters:

ch

A channel

Return value:

A channel

Example:

 

A

 

1

=demo.cursor("select * from SCORES where CLASS = 'Class one'")

 

2

=channel()

Create a channel

3

=channel(A2)

Create a channel  and be ready to push data in A2’s channel into the new channel, which is equivalent to =A2.push(channel())

4

>A2.select(STUDENTID==1)

 

5

>A3.select(STUDENTID==2)

 

6

=A2.fetch()

 

7

=A3.fetch()

 

8

=A1.push(A2)

 

9

=A1.fetch()

 

10

=A2.result()

11

=A3.result()

channel(ch)

Description:

Create a cluster channel and push data in another cluster channel into it.

Syntax:

channel(ch)

 

Note:

The function creates a cluster channel as synchronously segmented as cluster channel ch, pushes data in ch into it, and returns a cluster channel.

Parameters:

ch

A cluster channel

Return value:

A cluster channel

Example:

 

A

 

1

=file@n("E:/emp1.ctx","192.168.0.119:8281")

 

2

=A1.create()

Open a cluster table

3

=A2.attach(table1)

Retrieve cluster entity table table1

4

=A3.cursor()

Return a cluster cursor

5

=channel(A4)

Create a channel, be ready to push data in A4’s cluster cursor into the new channel, and return a cluster channel

6

=channel(A5)

Create a channel, be ready to push data in A5’s cluster channel into the new channel, and return a cluster channel

7

=A5.fetch()

Keep data of the cluster channel

8

=A6.fetch()

Keep data of the cluster channel

9

=A4.fetch()

 

10

=A5.result()

Get data from the cluster channel

11

=A6.result()

Get data from the cluster channel