T.attach( T’ )

Description:

Retrieve an attached table from a cluster composite table.

Syntax:

T.attach(T’)

Note:

The function retrieves attached table T’, which should already exist, from cluster composite table T.

Parameters:

T

A cluster composite table

T’

An attached table

Return value:

An attached table

Example:

Add an attached table to composite table emp1.ctx:

 

A

 

1

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

 

2

=A1.create(#EID,NAME)

Create the composite table’s base table

3

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

 

4

=A2.append(A3)

Append records to the base table

5

=A2.attach(t1, SURNAME,DEPT )

Add attached table t1 to the base table

6

=demo.cursor("select EID,SURNAME,DEPT from employee")

 

7

=A5.append(A6)

Append records to attached table t1

8

=A2.attach(t2,GENDER,SALARY)

Add attached table t2 to the base table

9

=demo.cursor("select EID,GENDER,SALARY from employee ")

 

10

=A8.append(A9)

Append records to attached table t2

 

Put emp1.ctx in node 192.168.0.116:8281:

 

A

 

1

=file("emp1.ctx",["192.168.0.116:8281"])

Open a cluster file

2

=A1.open()

Return a cluster composite table

3

=A2.attach(t1)

Retrieve attached table t1