Description:
Get the value of a specified field in a record.
Syntax:
r.field(F)
Note:
The function gets value of the Fth field in record r, or value of string parameter F. Count backward if F<0. Return null if F exceeds the boundary number of the fields or it does not exist.
Parameter:
r |
A record |
F |
The sequence number of a field, or the string parameter in which a variable can be used to reference the field name |
Return value:
The field value
Example:
|
A |
|
1 |
=demo.query("select * from EMPLOYEE")(1).field(2) |
Return the second field value of the first record in table sequence EMPLOYEE. |
2 |
=demo.query("select * from EMPLOYEE")(1).field(-2) |
Return the second-to-last field value in the first record of the table sequence EMPLOYEE. |
3 |
=demo.query("select * from EMPLOYEE")(1).field(arg1) |
arg1 is a variable. |
4 |
=demo.query("select * from EMPLOYEE")(1).field("SALARY") |
Return SALARY value in the first record of table sequelcne EMPLOYEE. |
Related functions: