Description:
The function alters fields in a table sequence.
Syntax:
T.alter(Fi,…;F’i,…)
Note:
The function modifies fields of table sequence T according to the specified order Fi,…, and arranges the other fields in their original order. Add parameter Fi as a new field if there isn’t such a field in the table sequence; parameter F’I is the field to be deleted.
Parameter:
T |
A table sequence. |
Fi |
Field name. |
F’i |
Field name. |
Return value:
Table sequence
Example:
|
A |
|
1 |
=demo.query("select class,studentid,subject,score from scores") |
The scores table contains columns as follows:
|
2 |
=A1.alter(classname;CLASS) |
Add a new field classname to A1’s table sequence and deletes CLASS field.
|
3 |
=A2.alter(classname,STUDENTID,gender) |
Add a new field gender to A2’s table sequence according to the specied position and arrange the rest of the fields after the specific ones in their original order.
|
4 |
=A3.alter(;gender,classname) |
Delete gender field and classname field.
|