6.8 Specifying Row IDs to Manipulate Data
A row ID (ROW_ID) recognizes a unique row of a table in the database. Use a single row SELECT statement or
FETCH statement to fetch a row ID. The host variable for receiving the row ID must correspond to the ROW_ID. For
the variable definition corresponding to each data type, see Table "SQL data types and equivalent C language host
variable data types" and Table "SQL date types and equivalent data types for COBOL host variables". Specify the
fetched row ID in the following search conditions to manipulate the row data.
· Search condition of the UPDATE statement:search
· Search condition of the DELETE statement:search
· Search condition of the WHERE clause in a query specification
The following shows an example of specifying row IDs.
Example:
In this example, data is updated by using row IDs.
6.9 Manipulating Data using Parallel Query
If a key item in the data search is known for jobs such as ordinary jobs, the efficiency of the data search can be
improved by preparing an index or similar facility. If the database for an ordinary job is used for document output in
batch processing at night, the search time may increase. To improve the efficiency of the batch processing, divide the
database into DSIs and perform a parallel search of the data in each DSI. This processing is called parallel query. To
use parallel query, make the following specifications:
· Specify PARALLEL for parallel query in the cursor declaration.
· Specify SQL96 for SQL_LEVEL in the application environment file.
· Specify the maximum number of parallel instances in MAX_PARALLEL in the application environment file.
For the division of a database into multiple DSIs, refer to the "RDB User's Guide: Database Definition." For application
environment files, refer to the "RDB User's Guide: Application Program Development."
The following is an example of specifying a parallel query.
Example:
Determine the sales amount for each product code by year and month.
122