E()

Read(1646) Label: two-layer sequence, conversion,

Description:

Convert a string, two-layer sequence, table sequence, record sequence or a single value to a specific type.

Syntax:

E(x)

Note:

When parameter x is a two-layer sequence, convert it to a multi-row table sequence where each row is a record and the first row holds column headers;

 

When parameter x is a string of rows separated by carriage return or a string of tab-separated columns, split them before conversion;

 

Convert to a two-layer sequence when parameter x is a table sequence or a record sequence.

Parameter:

x

A sequence/string/table sequence/record sequence/single value

Option:

@b

Do not use headers

@p

Transpose the two-layer sequence

@s

Return a string separated by carriage return or tab when parameter x is a table sequence

@1

Convert to a single-layer sequence; return a single-layer sequence when parameter x is a single value, and concatenation of members of the sequence when parameter x is a two-layer sequence

@2

Return a two-layer sequence when parameter x is a single value

Return value:

A table sequence, a sequence or a string

Example:

 

A

 

1

=connect("demo").query("select EID,NAME,DEPT,SALARY,HIREDATE from EMPLOYEE ")

2

=E@s(A1)

Return a string separated by carriage return or tab:

3

=E(A2)

4

=E@b(A3)

5

=E@bp([[1,4,5,6],["Emily","Ashley","Kuki","Lily"]])

6

=E@1(123)

Use @1 option to convert  a single value to a single-layer sequence, and return [123]

7

=E@1([[11,22],[33,44]])

Use @1 option to return the concatenation of members of of a two-layer-sequence; the result is [11,22,33,44]

8

=E@2(123)

Use @2 option to convert a single value to a two-layer sequence, and return [[123]]