Description:
Create a new composite table file using the data structure of an existing composite table.
Syntax:
T.create(f:b;x)
Note:
The function creates a new composite table file f using table structure of composite table T, and generates a multizone composite table file when the target f is a homo-name files group. f will include T’s attached tables.
Parameter:
T |
A composite table |
f |
A composite table file or a homo-name files group |
b |
Block size, whose unit is byte and whose default value is 【composite table block size】configured through menu option; when esProc is integrated in the third-party application, use blockSize value configured in raqsoftConfig.xml by default |
x |
An integer, which is zone table expression |
Option:
@u |
Do not compress data; use compression by default |
@r |
Generate a row-oriented file while by default generate a column-oriented one; a row-oriented composite table cannot use multicursor; do not compress a row-oriented file |
@y |
Forcibly to create the file even if a namesake one already exists; by default terminate the computation |
Return value:
Composite table
Example:
|
A |
|
1 |
=create(k1,v1).record([1,10,2,20]).cursor() |
Return a cursor that has data as follows:
|
2 |
=create(k1,k2,v2).record([1,11,111,2,22,222]).cursor() |
Return a cursor that has data as follows:
|
3 |
=file("ctb.ctx").open() |
Open a composite table file that contains an attached table table2. |
4 |
=A3.create@y(file("ctbCp.ctx")) |
Create new composite table file ctbCp.ctx, as well as its attached table, using data structure of composite table ctb.ctx; as @y works, forcibly create the file even if ctbCp.ctx already exists. |
5 |
=A4.append@i(A1) |
Append data of A1’s cursor to the base table of composite table ctbCp.ctx. |
6 |
=A4.attach(table2) |
Open A4’s attached table table2. |
7 |
=A6.append@i(A2) |
Append data of A2’s cursor to ctbCp.ctx’s attached table table2. |
Use @u option to not to compress the generated composite table file:
|
A |
|
1 |
=file("em.ctx").open() |
Open composite table file em.ctx. |
2 |
=A1.create@yu(file("ctbCp2.ctx")) |
Create a non-compressed composite table file ctbCp2.ctx using the existing composite table file em.ctx. |
3 |
=file("ctbCp2.ctx").structure() |
View structure of the composite table file ctbCp2.ctx; the false zip value means non-compression:
|
Use @r option to generate a row-oriented file:
|
A |
|
1 |
=file("em.ctx").open() |
Open composite table file em.ctx. |
2 |
=A1.create@yr(file("ctbCp3.ctx")) |
Create a row-oriented composite table file ctbCp3.ctx using the existing composite table file em.ctx. |
3 |
=file("ctbCp3.ctx").structure() |
View structure of the composite table file ctbCp3.ctx; the true row value represents row-oriented file:
|