Updated on 2025-05-29 GMT+08:00

PQexecParamsBatch

Description

Runs a command to bind batches of parameters.

Prototype

PGresult* PQexecParamsBatch(PGconn* conn, 
                            const char* command,
                            int nParams,
                            int nBatch, 
                            const Oid* paramTypes,
                            const char* const* paramValues,
                            const int* paramLengths,
                            const int* paramFormats,
                            int resultFormat);

Parameters

Table 1 PQexecParamsBatch parameters

Keyword

Description

conn

Connection handle.

command

SQL text string.

nParams

Number of parameters to be bound.

nBatch

Number of batch operations.

paramTypes

Types of parameters to be bound.

paramValues

Values of parameters to be bound.

paramLengths

Parameter lengths.

NOTICE:

In the following cases, the parameter length is forcibly set to the corresponding value of paramLengths:

  • The parameter is in binary format.
  • The parameter is in text format and the value of force_no_truncation is 1.

In these cases, paramLengths cannot be empty, and the caller must ensure the correctness of the parameter length.

paramFormats

Parameter formats (text or binary).

resultFormat

Result format (text or binary).

Return Values

PGresult pointers.