Hitachi

Hitachi Advanced Database Application Development Guide


5.15 Batch transfer of dynamic parameter values

Multiple dynamic parameter values can be transferred from an HADB client to the HADB server in the batch mode. This function is useful for accessing the HADB server from an HADB client and then using dynamic parameters to add, update, and delete data.

The following figure provides an overview of batch transfer of dynamic parameter values.

Figure 5‒22: Overview of batch transfer of dynamic parameter values

[Figure]

Explanation:

When multiple rows are inserted (INSERT statement) by using dynamic parameter values as row insertion values, the dynamic parameter values are normally transferred to the HADB server one set at a time (where a set consists of the dynamic parameter values to be inserted into one row).

In the case of batch transfer of dynamic parameter values, two or more sets of dynamic parameter values are transferred together in the batch mode. Because this method reduces the communication overhead, it also reduces the application program's execution time.

The figure above shows an example of row insertion (INSERT statement), but batch transfer of dynamic parameter values is also applicable to the UPDATE and DELETE statements.

If a JDBC driver is used, dynamic parameter values are transferred in the batch mode when SQL statements are executed by using the executeBatch method or executeLargeBatch method of the PreparedStatement class.

If CLI functions are used, dynamic parameter values are transferred in the batch mode when the SQL statements are executed in the following order:

  1. Preprocess the INSERT, UPDATE, or DELETE statement.

  2. Use a_rdb_SQLBindArrayParams() to perform batch binding of the dynamic parameters.

  3. Use the statement handle preprocessed in 1 to execute the SQL statement by a_rdb_SQLExecute().

If an ODBC driver is used, batch transfer of dynamic parameter values is not available.

Notes
  • If an error occurs during execution of an SQL statement and the processing is rolled back, the number of results rows is discarded and only the error information is returned to the HADB client.

  • You must re-estimate the memory requirements for the HADB servers and clients, because batch transfer of dynamic parameter values requires memory resources. For details about the memory requirements for HADB servers, see Determining the memory requirement during normal operation in the HADB Setup and Operation Guide. For details about the memory requirements for HADB clients, see C. Estimating the Memory Requirements for an HADB Client

  • If you perform batch transfer of dynamic parameter values for an SQL statement with the scalar function RANDOMCURSOR specified, the scalar function RANDOMCURSOR generates a pseudorandom number for each set of dynamic parameters.