PQsendQuery

Function

PQsendQuery is used to commit a command to the server without waiting for the result. If the query is successful, 1 is returned. Otherwise, 0 is returned.

Prototype

int PQsendQuery(PGconn *conn, const char *command);

Parameter

Table 1 PQsendQuery parameters

Keyword

Parameter Description

conn

Points to the object pointer that contains the connection information.

command

Query string to be executed.

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

After PQsendQuery is successfully called, call PQgetResult one or more times to obtain the results. PQsendQuery cannot be called again (on the same connection) until PQgetResult returns a null pointer, indicating that the command execution is complete.

Example

For details, see Example.

Feedback
编组 3备份
    openGauss 2024-06-24 00:44:47
    cancel