This shows you the differences between two versions of the page.
dev:sql:statements:update:home [2010/07/02 18:13] tdo |
dev:sql:statements:update:home [2016/06/28 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{page>:top_add&nofooter&noeditbtn}} | ||
- | <html><div align="center"><span style="color:red">DRAFT</span></div></html> | ||
- | ====== Omnidex SQL UPDATE ====== | ||
- | {{page>:sql_bar&nofooter&noeditbtn}} | ||
- | |||
- | ===== Description ===== | ||
- | |||
- | Update existing data in a database. | ||
- | ===== Syntax ===== | ||
- | |||
- | UPDATE table_spec SET column-assignments | ||
- | [WHERE < predicate-list | CURRENT > | ||
- | [ < ON / OF > [ CURSOR ] cursor ] ] | ||
- | [WITH options] | ||
- | |||
- | |||
- | ===== Discussion ===== | ||
- | |||
- | == tablespec == | ||
- | |||
- | Required. The name of the table containing the data to be updated. | ||
- | |||
- | == column-assignments == | ||
- | |||
- | Required. A comma separated list of column name/new value pairs. (column-name = new-value, ...) | ||
- | |||
- | == WHERE predicate-list | CURRENT == | ||
- | |||
- | Optional. Provide a predicate-list to qualify specific rows to be updated or update only the CURRENT row. Caution! If omitted, ALL rows will be updated with the new values. | ||
- | predicate-list - Criteria to determine which rows will be updated. | ||
- | CURRENT - Update only the current row. | ||
- | |||
- | == [ON [CURSOR] cursor] == | ||
- | |||
- | Optional. The cursor on which to perform the delete. If omitted, the delete will be performed on the current cursor. | ||
- | |||
- | [WITH options] | ||
- | Optional - Specify options to be used for this command. | ||
- | |||
- | ===== Examples ===== | ||
- | |||
- | ==== Simple ==== | ||
- | UPDATE INVENTORY SET PRICE=10.95 WHERE PRICE=9.95 | ||
- | |||
- | This example creates an OST that contains customers who have canceled their order. Then customers whose orders are on back order, are added to the OST. | ||
- | |||
- | {{page>:bottom_add&nofooter&noeditbtn}} |