![]() SQL database system |
This manual page descibes the INSERT,
UPDATE,
and
DELETE
commands.
INSERTINSERT writes one new row to a database table.
If fieldnames are not specified then table fields will be taken in natural order, which is probably a risky coding practice (use tabdef(1) to list the table's fields). Each value must be a constant. Any fields not mentioned will be initialized to null. Zero-length constants will be converted to null. INSERT cannot be used on temporary tables or ordinary files. Examples:
UPDATEUPDATE modifies one or more existing rows in a table, or can add a new row if ORINSERT is used.
A WHERE clause is always required. It is not considered an error if no rows are found that meet the where clause (the row count may be checked to determine this). Each value must be a constant. Zero-length constants will be converted to null. shsql extends standard SQL with the keywords ORINSERT and MAXROWS. If ORINSERT is specified, record(s) will be updated normally if found, but if not found a new record will be inserted (fields not SET will be null). MAXROWS may be used to raise the default row limit of 2000 rows or be set to a low number (typically 1) to ensure that an update will only affect an anticipated number of rows. If MAXROWS is exceeded the entire update is cancelled. UPDATE cannot be used on temporary tables or ordinary files. Example:
DELETEDELETE deletes one or more existing rows.
A
WHERE clause
is always required.
It is not considered an error if no rows are found that meet the where clause
(the row count may be checked to determine this).
MAXROWS is a shsql extension and has similar function as with UPDATE,
described above.
Example:
|
![]() Copyright Steve Grubb |