cs .new()

Read(80) Label: cursor, field value,

Description:

Return a cursor with newly-computed field values for its records.

Syntax:

cs.new(xi:Fi,…)

Note:

The function computes expression xi against each record in cursor cs, names the newly-computed Fi fields, and returns the original cursor containing Fi fields.

Parameters:

cs

Cursor

xi

An expression, whose values are uses as the new field values. It is treated as null if omitted; in that case, : Fi can’t be omitted. The sign # is used to represent a field with a sequence number

Fi

Field name of cs; use the identifiers parsed from expression xi if it is omitted

Options:

@i

Won’t generate a record if the result of expression xi is null

Return value:

  The original cursor with new field values

Example:

 

A

 

1

=connect("demo").cursor("select * from SCORES where SCORES<60")

 

2

=A1.new(#2:ID, CLASS, SCORE+5:newScores)

Generate a new cursor composed of ID, CLASS, and newScores by performing expression evaluation on the existing SCORE field

3

=A2.fetch()

4

=file("D:\\txt_files\\1.txt").cursor@t()

Below is the file data1.txt:

5

=A4.new@i(CLASS,STUDENTID,SUBJECT,SCORE:score)

If the SCORE value is null, the corresponding record won’t be generated

6

=A5.fetch()