Description:
Attach a computation to a channel, which will split each of its records and perform union on the splitting result.
Syntax:
ch.conj(x)
Note:
The function attaches a computation to channel ch, which will split each of its records according to result of computing expression x into a sequence or a record sequence, union the result members or records, and return the original channel ch.
This is an attachment computation.
Parameter:
ch |
A channel. |
x |
An expression that returns a record sequence/table sequence. |
Return value:
Channel
Example:
|
A |
|
1 |
=demo.cursor("select * from GYMNASTICSWOMEN") |
Return a cursor.
The above is content of GYMNASTICSWOMEN table. |
2 |
=channel() |
Create a channel. |
3 |
=A2.conj(create(ID,NAME,COUNTRY,SUBJECT,SCORES).record([ID,NAME,COUNTRY,"VAULT" ,VAULT,ID,NAME,COUNTRY,"UNEVENBARS",UNEVENBARS,ID,NAME,COUNTRY, "BALANCEBEAM",BALANCEBEAM,ID,NAME,COUNTRY,"FLOOR",FLOOR])) |
Attach a computation to channel A2, which will perform column-to-row transposition on VAULT, UNEVENBARS, BALANCEBEAM and FLOOR fields, and return the original channel. |
3 |
=A2.fetch() |
Execute the result set function in channel A2 and keep the current data in channel. |
4 |
=A1.push(A2) |
Be ready to push data in A1’s cursor into the channel, but the action needs to wait. |
5 |
=A1.fetch() |
Fetch data from cursor A1 while pushing data into the channel to execute the attached computation and keep the result. |
6 |
=A2.result() |
Get channel A2’s result:
|