5.1.3 Array Binding

Table of Contents Previous Next


5 libpq C Library : 5.1.3 Array Binding

Details of PQprepare() can be found in the prepared statement section.
5.1.3.1 PQBulkStart
PQBulkStart() initializes bulk operations on the server. You must call this function before sending bulk data to the server. PQBulkStart() initializes the prepared statement specified in stmtName to receive data in a format specified by paramFmts.
5.1.3.2 PQexecBulk
PQexecBulk() is used to supply data (paramValues) for a statement that was previously initialized for bulk operation using PQBulkStart().
This function can be used more than once after PQBulkStart() to send multiple blocks of data. See the example for more details.
5.1.3.3 PQBulkFinish
Alternatively, you can use the PQexecBulkPrepared() function to perform a bulk operation with a single function call. PQexecBulkPrepared() sends a request to execute a prepared statement with the given parameters, and waits for the result. This function combines the functionality of PQbulkStart(), PQexecBulk(), and PQBulkFinish(). When using this function, you are not required to initialize or terminate the bulk operation; this function starts the bulk operation, passes the data to the server, and terminates the bulk operation.
Specify a previously prepared statement in the place of stmtName. Commands that will be used repeatedly will be parsed and planned just once, rather than each time they are executed.
The following example uses PGBulkStart, PQexecBulk, and PQBulkFinish.
The following example uses PQexecBulkPrepared.

5 libpq C Library : 5.1.3 Array Binding

Table of Contents Previous Next