T.keys( Ki,… )

Read(901) Label: define, memory table, key,

Description:

Define the key(s) for an in-memory table.

Syntax:

T.keys(Ki,…)

Note:

The function defines key(s) Ki,…, which may include the time key, for in-memory table T.

Parameter:

Ki

Key name; can be one or multiple keys; delete all keys of an in-memory table when the parameter is absent

T

An in-memory table

Optios:

@t(…,KT)

Set the last parameter KT as the time key and all other key fields constitute the basic key

Return value:

An in-memory table

Example:

 

A

 

1

=demo.cursor("select EID,NAME,GENDER from EMPLOYEE where EID<10")

Return cursor of the retrieved data.

2

=A1.memory()

Return an in-memory table:

3

=A2.keys(EID,NAME)

Set EID and NAME as the in-memory table’s keys.

4

=A3(1).key()

Get the keys of the first record and return the result:

5

=A2.keys()

Delete all keys of the in-memory table.

6

=A3(1).key()

Query the keys of the first record and return null.

7

=demo.cursor("select * from employee").memory()

Return an in-memory table.

8

=A7.keys@t(EID,HIREDATE)

Set EID as the basic key and HIREDATE as the time key in A7’s in-memory table.