Description:
Attach the action of computing expression to a cursor and return the original cursor.
Syntax:
cs.(x)
Note:
The function computes expression x on each member of the cursor and returns the original cursor.
This is a delayed function.
Parameter:
cs |
A cursor |
x |
An expression that is generally a single field name or a legal expression composed of multiple field names; both can use ~ to reference the current record; can be omitted |
Return value:
Cursor
Example:
|
A |
|
1 |
=connect("demo").cursor("select top 5 EID,NAME,HIREDATE from EMPLOYEE where EID<10") |
Return a cursor. |
2 |
=A1.(age(HIREDATE)) |
Attach a computation to cursor A1 – compute the length of service according to HIERDATE, and return the original cursor. |
3 |
=A1.fetch() |
Fetch data from cursor A1 on which the attached computation is already executed (it would be better to fetch data in batches when data amount involved is huge):
|
4 |
=A1.reset() |
Reset cursor A1 and move it back to the beginning. |
5 |
=A1.(2*~+1) |
Attach a computation to cursor A1 – compute length of service*2+1 and ~ references the current record, and return the original cursor. |
6 |
=A1.fetch() |
Fetch data from cursor A1 on which A5’s computation is already executed:
|
When parameter x is absent:
|
A |
|
1 |
=demo.cursor("select top 3 DEPT,MANAGER from DEPARTMENT") |
Return a cursor. |
2 |
=A1.() |
As parameter x is absent, no computation is performed on cursor A1 and the function returns the same cursor. |
3 |
=A1.skip() |
Get the number of records in cursor A1 and return 3. |