Isc_dsql_batch_execute_immed

From InterBase
Jump to: navigation, search

Go Up to API Function Reference


The isc_dsql_batch_execute_immed function is used to execute a group of INSERT, UPDATE, DELETE or DDL commands. Grouping SQL statements into batches reduces the amount of network traffic between the client and the database server.

Note: A related function, isc_dsql_batch_execute, allows you to batch the data used in a parameterized SQL statement. For API information about this related function, see isc_dsql_batch_execute. For an introduction to batch updates, see “Database Statistics and Connection Monitoring” in the InterBase Operations Guide.

The signature for isc_dsql_batch_execute_immed is:

Syntax

ISC_STATUS isc_dsql_batch_execute_immed(ISC_STATUS *status_vector,
isc_db_handle *db_handle, isc_tr_handle *tr_handle, int dialect,
ISC_ULONG number_of_sql, char[] *sql, ISC_ULONG *rows_affected);

The meaning of each parameter is explained in the following table:

isc_dsql_batch_execute_immed Parameters
Argument Description

status_vector

The address of an array of type ICS_STATUS.

The respective ISC_STATUS values for each SQL statement in the batch will be returned in this array.

db_handle

The address of the database handle.

tr_handle

The address of the transaction handle.

dialect

The SQL dialect to use for the statements in the batch update.

number_of_sql

The number of SQL statements included in the batch update. This argument reflects the number of strings in the sql array.

sql

An array of NULL-terminated strings. Each string is an SQL statement to execute in the batch update.

The SQL statements do not need to be terminated with semicolons. Instead, each SQL statement is terminated by a C NULL character.

rows_affected

A pre-allocated array of type ISC_ULONG, which will be used to store the number of rows affected by the corresponding SQL statement in the sql array.

If a statement fails, the ISC_STATUS will be set, and the corresponding entry in the rows_affected array will be set to -1, or 0xFFFFFFFF.

Topics

Advance To: