Fujitsu J2X0-1634-01EN Computer Accessories User Manual


 
3.2.7 Updating all rows in a table
To update all rows in a table, do not specify any search conditions or the keyword "WHERE".
Review the example in Figure: Example of using values from other columns to update data. In this example, when
shipment data was produced, the values for SHIPQTY and PREVSHIPMT were updated. However, VARIATION was
not specified. In the following example, VARIATION is specified to be updated to the current value. The following is an
example of specifying a value for VARIATION:
Example:
In this example, the value of VARIATION in all rows in the SHIPMT table is updated to the value
derived by subtracting PREVSHIPMT from SHIPQTY.
[Figure: Example of updating all rows in a table]
In this example, the value of VARIATION was updated in all rows. However, for rows for which shipment data was not
produced since the previous update, the actual values did not change. Nevertheless, data in these rows was updated.
In other words, the value was updated to a value equal to the original value. The ratio of rows in which the actual
value does not change may be large compared to the row count for the entire table. Therefore, using a method to
manage rows such that only the required rows are updated, would improve processing efficiency.
3.3 Deleting Data from a Data Base
To delete data from a table, use the DELETE statement. The following is an example of the DELETE statement:
Example:
In this example, the row for CUSTOMER 61 and PRODNO 215 is deleted from the ORDER table.
35