T.cursor( …;w;mcs )

Description:

Divide a memory table in sync with a memory multicursor and return it also as a memory multicursor.

Syntax:

T.cursor(...;w;mcs)

Note:

The function filters memory table T according to filtering condition w and returns the table as a memory multicursor in sync with multicursor mcs. The ellipsis parameter, generally omitted, represents the selected field(s), and the semicolon after it must be alwasys present.

Parameters:

T

A memory table

w

Filtering condition

mcs

A multicursor generated from a memory table or a composite table

Return value:

A memory multicursor

Example:

 

A

 

1

==demo.cursor("select * from employee where EID < 10")

Return the retrieved data as a cursor

2

=A1.memory().keys(EID)

Return a memory table for which the key is set as EID

3

=file("d://emp.ctx").create().cursor@m()

Open a composite table and return it as a multicursor

4

=A2.cursor(;SALARY>8000;A3)

Return a memory multicursor in sync with A3’s multicursor

mcs.cursor(n)

Description:

Merge subcursors in a multicursor into a single cursor or a new multicursor with a smaller number of parallel subcursors.

Syntax:

mcs.cursor(n)

Note:

The function merges subcursors in a multicursor into a single cursor, which is the default, or a new multicursor with a smaller number, which is specified by parameter n, of parallel subcursors.

Parameters:

mcx

A memory table/a cluster memory table

n

Subcursor column name

Return value:

A common cursor or a multicursor

Example:

 

A

 

1

=file("D:\\dept2.txt").cursor@m()

Retrieve dept2.txt as a multicursor

2

=A1.fetch()

Fetch records from A1’s multicursor

3

=A2.cursor().groups(#3:FATHER;count(#1):TOTAL)

Merge the multicursor into a common cursor and perform grouping & aggregation