ch. run()

Read(1104) Label: channel, record, expression,

Description:

Attach a computation that assigns values to a specified field and return the original channel.

Syntax:

ch.run (xi:Fi,…)

Note:

The function attaches a computation to channel ch, which will compute expression xi on each of its records and assign the results to Fi field, and returns the original channel ch.

This is an attachment computation.

Parameter:

ch

A channel

xi

An expression

Fi

Field name in the given channel

Return value:

Channel

Example:

 

A

 

1

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

 

2

=channel()

Create a channel.

3

=A2.run(SALARY+1000:SALARY)

Attach a computation to A2’s channel, which will evaluate expression SALARY+1000 and assign the results to SALARY field, and return the original channel.

4

=A2.fetch()

Execute the result set function in channel A2 and keep the current data in channel.

5

=A1.push(A2)

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

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 channel A2’s result: