Scalable Database Server, HiRDB Version 8 Description

[Contents][Glossary][Index][Back][Next]

5.2.3 Data updating

Data updating is the process of changing information in a table. The data updating methods and an example of specifying SQL statements are shown as follows.

Data updating methods
The UPDATE statement is used to update data. The following three methods are available for data updating:
  • Updating the row being pointed to by the cursor
  • Updating only those rows that satisfy a condition (specify the WHERE clause in the UPDATE statement)
  • Updating by row (specify ROW in the SET clause)

Data updating SQL specification example
An example of updating only those rows that satisfy a condition is explained as follows.
Example
In this example, the UPDATE statement updates to 20 the stock quantity (SQUANTITY) of products whose product code (PCODE) in the stock table (STOCK) is 411M:
 
UPDATE STOCK
  SET SQUANTITY=20
  WHERE PCODE='411M'