T.memory( C,…;w )

Read(465) Label: entity table, in-memory table,

Description:

Generate an in-memory table from an entity table.

Syntax:

T.memory(C,…;w)

Note:

The function filters entity table T according to filtering condition w and imports the data into the memory to generate an in-memory table containing column C. we can handle an in-memory table as we do to a table sequence. When parameter C,… is absent but parameter w is present, the semicolon before w can’t be omitted. If a column C is preceded by # in the entity table, column C will be the key of in-memory table T. Use null to record a C value if it does not exist in T. The in-memory table inherits the entity table’s key if you don’t set a key for it.

Parameters:

C

A column name; import all columns when the parameter is omitted

w

Filtering condition; won’t perform filtering when the parameter is omitted

T

An entity table in a composite table

Options:

@p

Group the would-be in-memory table by the first field, which must be ordered; when the first field is already segmented and the to-be-retrieved field, the result table will inherit the segmentation

@v

Use column-wise memory access

@z

Generate an in-memory table of a compressed format; the option should work with @v option

Return value:

  An in-memory table

Example:

 

A

 

1

=file("D:\\employees.ctx")

employees is an existing composite table file

2

=A1.open()

Open the composite table

3

=A2.attach(t1)

Return the composite table’s attached table t1

4

=A2.memory()

Generate an in-memory table using all columns of the base table

5

=A2.memory(EID,Dept,Name;EID<5)

Get some columns where EID<5 from the base table to generate an in-memory table

6

=A3.memory()

Get all columns from the attached table to generate an in-memory table

7

=file("emp.ctx").open()

 

8

=A7.memory@p(EID2,NAME,GENDER;GENDER=="M")

Use @p option to group the would-be in-memory table by the first field

9

=file("emp.ctx").open()

 

10

=A9.memory@vz()

Generate an in-memory table of a compressed format