Rdb: Ruby-Nachbau der MWC /rdb-Werkzeuge
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
.TH delete "" "" "/rdb Command"
|
||||
.PC "Blank record and update index file"
|
||||
\fBdelete [-m[bhirs]] \fItable keycolumn ... \fB< \fIkeytable\fR
|
||||
.PP
|
||||
.II row^delete
|
||||
.II "delete row"
|
||||
The command
|
||||
.B delete
|
||||
writes a blank record on the row in
|
||||
.I table
|
||||
whose key matches the row in the
|
||||
.IR keytable .
|
||||
It also deletes the offset row in the appropriate fast-access
|
||||
offset table, or, in the case of the
|
||||
.B hash
|
||||
method, replaces the deleted offset with \-1.
|
||||
.PP
|
||||
Options
|
||||
.B \-m[bhirs]
|
||||
lets you select a type of fast-accessing to locate the row to delete.
|
||||
For information on the type of fast accessing that each option invokes,
|
||||
see the manual entry for
|
||||
.BR index .
|
||||
.SH Example
|
||||
Consider table
|
||||
.BR inventory ,
|
||||
which appears as follows:
|
||||
.DM
|
||||
Item Amount Cost Value Description
|
||||
---- ------ ---- ----- --------------
|
||||
1 3 50 150 rubber gloves
|
||||
2 100 5 500 test tubes
|
||||
3 5 80 400 clamps
|
||||
4 23 19 437 plates
|
||||
5 99 24 2376 cleaning cloth
|
||||
6 89 147 13083 bunsen burners
|
||||
7 5 175 875 scales
|
||||
.DE
|
||||
.PP
|
||||
The
|
||||
.B record
|
||||
index looks like this:
|
||||
.DM
|
||||
Offset
|
||||
--------
|
||||
76
|
||||
113
|
||||
147
|
||||
177
|
||||
207
|
||||
245
|
||||
283
|
||||
.DE
|
||||
.PP
|
||||
The following command deletes the first record
|
||||
.BR Item 1:
|
||||
.DM
|
||||
echo 1 | delete -mr inventory Item
|
||||
.DE
|
||||
.PP
|
||||
.B inventory
|
||||
now appears as follows:
|
||||
.DM
|
||||
Item Amount Cost Value Description
|
||||
---- ------ ---- ----- --------------
|
||||
|
||||
2 100 5 500 test tubes
|
||||
3 5 80 400 clamps
|
||||
4 23 19 437 plates
|
||||
5 99 24 2376 cleaning cloth
|
||||
6 89 147 13083 bunsen burners
|
||||
7 5 175 875 scales
|
||||
.DE
|
||||
.PP
|
||||
.B inventory.r
|
||||
now appears as follows:
|
||||
.DM
|
||||
Offset
|
||||
--------
|
||||
113
|
||||
147
|
||||
177
|
||||
207
|
||||
245
|
||||
283
|
||||
.DE
|
||||
.PP
|
||||
Note that we have blanked out the record and removed the
|
||||
offset.
|
||||
.SH "See Also"
|
||||
.B
|
||||
append,
|
||||
index,
|
||||
replace
|
||||
.R
|
||||
.SO delete
|
||||
Reference in New Issue
Block a user