Using QMF

D. -- Delete rows from a table

To delete one or more rows from a table, put the operator D. under the table name in the row you want deleted.

You can delete rows from a table that you created or from a copy of a table that someone else created. (You need authorization to create or copy a table.) To copy the Q.STAFF sample table, for example, enter DISPLAY Q.STAFF. When Q.STAFF displays, enter SAVE DATA AS PERS. The examples that use D. assume that you created (or copied) a table and called it PERS.

This query deletes the row that contains the ID number 140 from the PERS table:



PERS | ID           | NAME | DEPT | JOB | YEARS | SALARY | COMM |
-----+--------------+------+------+-----+-------+--------+------|
D.   | 140          |      |      |     |       |        |      |

You can delete more than one row with one DELETE statement.

This query deletes everyone in Department 10:



PERS | ID | NAME | DEPT | JOB | YEARS | SALARY | COMM |
-----+----+------+------+-----+-------+--------+------|
D.   |    |      | 10   |     |       |        |      |

The example table with D. can have multiple rows, but you cannot mix the operators D., I., P., or U. in a single example table.

Attention:
If D. appears under the table name with no conditions in other columns, QMF deletes the entire contents of the table.

Rules for D.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]