T.find( k;x:C,.. )

Description:

Find the record(s) according to the specified primary key value(s) from a base table.

Syntax:

T.find(k;x:C,..)

Note:

The function finds the record(s) where key value(s) is k and returns a record/record sequence containing one field C. The key value k can be represented by the first dimension value which can uniquely identify a record.

Parameters:

T

Base table

k

The primary key; write multiple keys as a sequence

x

Column name; retrieve all field if omitted

C

Column alias; can be omitted

Options:

@k

Find multiple records according to multiple primay keys and return them as a record sequence; by default the function returns the first-found record whose primary key is k ; write a composite primary key in the format of [[k1,k2],[...],...]

Return value:

A record/record sequence

Example:

 

A

 

1

=file("E:/find1.ctx")

Return a cursor

2

=A1.open()

Open a composite table’s base table whose dimensions are EID and NAME

3

=A2.find([8,"Megan"])

Since parameter x is absent, the function returns all columns

4

=A2.find([8,"Megan"];EID,SALARY)

Return specified columns

5

=A2.find@k([[4,"Emily"], [8,"Megan"]];EID,SALARY)

Find multiple records with @k option