Description:
Alter fields of a record.
r.alter(Fi,…;F’i,…)
Note:
The function alters fields of record r in the order of Fi,…. If the to-be-altered fields are not specified, perform the modification according to the original order of fields; if field Fi does not exist in the record, add it as a new field. F’i is the to-be-deleted fields.
Parameter:
r |
A record. |
Fi |
Field names. |
F’i |
Names of to-be-deleted fields. |
Return value:
Record
Example:
|
A |
|
1 |
=demo.query("select top 9 class,studentid,subject,score from scores") |
Return a table sequence:
|
2 |
=A1(1) |
Return the 1st record of table sequence A1:
|
3 |
=A2.alter(classname;CLASS) |
Add classname field to A2’s record while deleting CLASS field:
|
4 |
=A2.alter(classname,STUDENTID,gender) |
Add classname field and gender field to A2’s record according to the order classname,STUDENTID,gender; put the rest of the fields CLASS,SUBJECT,SCORE after them:
|
5 |
=A2.alter(;CLASS) |
Delete CLASS field from A2’s record:
|