mcursor()

Read(299) Label: mcursor,

Here’s how to use mcursor() function.

CS. mcursor()

Description:

Generate a multicursor based on a sequence of cursors.

Syntax:

CS.mcursor()

Note:

The function generates a multicursor based on CS, a sequence of cursors. Every cursor in the cursor sequence must have the same structure. A multi-multicursorwill be generated if CS is a sequence of multicursor.

Parameters:

CS

A sequence of cursors

Return value:

Multicursor

Example:

test_mcs.dfx is the deployment file for deploying remote node servers. The nodes are "192.168.0.204"," 192.168.0.205","192.168.0.206"; their port numbers are 8081. Below is the file:

 

A

1

=connect("demo").cursor("select * from SCORES  where SUBJECT=?",arg1)

2

return A1

 

 

A

 

1

=callx("test_mcs.dfx",["English","Math","PE"];["192.168.0.204:8081","192.168.0.205:8081","192.168.0.206:8081"])

Each of the three parallel nodes returns a cursor to form a cursor sequence

2

=A1.mcursor()

Generate a multicursor based on the cursor sequence

3

=A2.fetch()

Fetch all records from the multicursor

cs. mcursor()

Description:

Generate a multicursor based on one cursor.

Syntax:

cs.mcursor(n)

Note:

The function generates a multicursor based on cursor cs, from which data is fetched and stored in n subcursors. If n isn’t set, the default value is the number of parallel tasks set in Tool>Options.

Parameters:

cs

A single cursor

n

An integer

Return value:

Multicursor

Example:

 

A

 

1

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

 

2

=A1.mcursor(3)

Create a multicursor