PQsendPrepare
Description
Sends a request to create a prepared statement with given parameters, without waiting for completion.
Prototype
int PQsendPrepare(PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes);
Parameters
Keyword |
Description |
---|---|
conn |
Points to the object pointer that contains the connection information. |
stmtName |
Name of prepare to be executed. |
query |
Query string to be executed. |
nParams |
Parameter quantity. |
paramTypes |
Array of the parameter type. |
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
This function is an asynchronous version of PQprepare. If it can dispatch a request, 1 is returned. Otherwise, 0 is returned. After a successful calling, call PQgetResult to check whether the server successfully created the prepared statement. The parameters of the function are processed in the same way as PQprepare. Like PQprepare, it cannot work on connections using protocol v2.0.
Example
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