文档首页/ 云数据库 GaussDB/ 开发指南(集中式_V2.0-8.x)/ 应用程序开发教程/ 基于libpq开发/ libpq接口参考/ 数据库执行语句函数/ PQexecPreparedBatchEx
更新时间:2026-03-23 GMT+08:00
PQexecPreparedBatchEx
功能描述
BatchErrorMode批量请求接口。
原型
PGresult* PQexecPreparedBatchEx(PGconn* conn,
const char* stmtName,
int nParams,
int nBatchCount,
const char* const* paramValues,
const int* paramLengths,
const int* paramFormats,
int resultFormat,
PQStmtAttr attr,
int allowedErrorsCount); 参数
| 关键字 | 参数说明 |
|---|---|
| conn | 连接句柄。 |
| stmtName | prepared 语句名字。 |
| nParams | 动态绑定参数的字段数。 |
| nBatchCount | 批量绑定的行数。 |
| paramValues | 绑定参数值。 |
| paramLengths | 参数值的数据长度。 须知: 下列情况中,参数长度强制使用paramLengths中对应的值:
此时paramLengths不允许为空,并且参数长度的正确性须由调用者自行保证。 |
| paramFormats | 参数的格式(文本或二进制)。 |
| resultFormat | 结果的格式(文本或二进制)。 |
| attr | 此次批量执行属性,是否使用批量错误跳过模式。取值范围:STMT_DEFAULT , STMT_BATCH_ERRORS。 |
| allowedErrorsCount | 使用批量错误跳过模式时,允许的最大错误数。 |
返回值
PGresult类型指针。
父主题: 数据库执行语句函数