Description:
Delete specified record(s) from an entity table.
Syntax:
T.delete(P)
Note:
The function deletes from entity table T the records that match key values of record sequence P. If T is the base table having an attached table, delete records having same dimensions from the attached table.
Parameters:
T |
An entity table |
P |
A record sequence having same structure as T |
Options:
@n |
Return deleted record(s) from the record sequence |
Example:
|
A |
|
1 |
=file("emp.ctx") |
An existing composite table file |
2 |
=A1.open() |
Open the composite table’s base table |
3 |
=A2.cursor().fetch() |
Get data in the base table: |
4 |
=A2.attach(table3) |
Return the base table’s attached table table3 |
5 |
=A4.cursor().fetch() |
Get data of the attached table |
6 |
=create(EID,NAME).record([1,"aaa",21,"bbb"]) |
Return a table sequence |
7 |
=A2.delete@n(A6) |
Delete records from both the table sequence and the base table where the former’s key values are contained in the latter’s corresponding key values; @n option is used to return the deleted record |
8 |
=A2.cursor().fetch() |
Check the base table to see that the record where key EID value is 1 is deleted |
9 |
=A4.cursor().fetch() |
Check the attached table to see that the record with same dimension value is deleted |