PQsendQueryParams
Function
PQsendQueryParams is used to submit a command and separate parameters to the server without waiting for the result.
Prototype
int PQsendQueryParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char * const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat);
Parameter
Keyword |
Parameter Description |
---|---|
conn |
Points to the object pointer that contains the connection information. |
command |
Query string to be executed. |
nParams |
Parameter quantity. |
paramTypes |
Parameter type. |
paramValues |
Parameter value. |
paramLengths |
Parameter length. |
paramFormats |
Parameter format. |
resultFormat |
Result format. |
Return Value
int indicates the execution result. 1 indicates successful execution and 0 indicates an execution failure. The failure cause is stored in conn->errorMessage.
Precautions
PQsendQueryParams is equivalent to PQsendQuery. The only difference is that query parameters can be specified separately from the query string. PQsendQueryParams parameters are handled in the same way as PQexecParams parameters. Like PQexecParams, PQsendQueryParams cannot work on connections using protocol v2.0 and it allows only one command in the query string.
Examples
For details, see Example.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot