T.keys( Ki,… )

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

Description:

Set key(s) for an in-memory table.

Syntax:

T.keys(Ki,…)

Note:

The function sets Ki,…as the key of 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(Ki,…,KT)

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

Return value:

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:

In a esProc result set, a field whose name is marked by  is a key field.

4

=A3(1).key()

 

Get base key values of the in-memory table’s first record and return [1, " Rebecca"].

5

=A2.keys()

Delete all keys of the in-memory table as the parameter is absent.

6

=A3(1).key()

Get base key values of the in-memory table’s first record and return null.

7

=demo.cursor("select EID,NAME,HIREDATE from employee").memory()

Return an in-memory table.

8

=A7.keys@t(EID,HIREDATE)

Set EID as the base key and HIREDATE as the time key in A7’s in-memory table:

9

=A7(1).key()

Get base key values of the in-memory table’s first record and return 1.