Using Batch Updates to Submit Multiple Statements

From InterBase
Jump to: navigation, search

Go Up to Interactive Query

Batch updates allow you to send a group of SQL statements to a server in a single unit. Grouping SQL statements into batches reduces the amount of network traffic between the client and the database server. This results in improved performance, especially in LAN and WAN environments.

Note: Batch updates only work using the InterBase 2007 client library and an InterClient JDBC driver.

You can send multiple INSERT, UPDATE, and DELETE statements to the server using batch updates. In response, the server returns an array of ULONG values that reflect the number of affected rows per statement.

SQL statements such as SELECT and CREATE DATABASE are not supported in batch updates. SQL DDL is supported.

Figure 1.2 shows the flow of communication between client and server when completing a number of INSERT statements using traditional InterBase client APIs. Note the flow of communication shown in the figure also applies to UPDATE and DELETE statements.

INSERT Without Batch Updates

Figure 1.3 shows the flow of communication when using batch updates. Note the reduction in network traffic, resulting in better performance.

INSERT With Batch Updates