<term><function>PQsendQuery</function><indexterm><primary>PQsendQuery</primary></indexterm></term>
<listitem>
<para>
Submits a command to the server without waiting for the result(s).
1 is returned if the command was successfully dispatched and 0 if
not (in which case, use <xref linkend="libpq-PQerrorMessage"/> to get more
information about the failure).
<synopsis>
int PQsendQuery(PGconn *conn, const char *command);
</synopsis>
After successfully calling <xref linkend="libpq-PQsendQuery"/>, call
<xref linkend="libpq-PQgetResult"/> one or more times to obtain the
results. <xref linkend="libpq-PQsendQuery"/> cannot be called again
(on the same connection) until <xref linkend="libpq-PQgetResult"/>
has returned a null pointer, indicating that the command is done.
</para>
<para>
In pipeline mode, this function is disallowed.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-PQsendQueryParams">
<term><function>PQsendQueryParams</function><indexterm><primary>PQsendQueryParams</primary></indexterm></term>
<listitem>
<para>
Submits a command and separate parameters to the server without
waiting for the result(s).
<synopsis>
int PQsendQueryParams(PGconn *conn,
const char *command,
int nParams,
const Oid *paramTypes,
const char * const *paramValues,
const int *paramLengths,
const int *paramFormats,
int resultFormat);
</synopsis>
This is equivalent to <xref linkend="libpq-PQsendQuery"/> except that
query parameters can be specified separately from the query string.
The function's parameters are handled identically to
<xref linkend="libpq-PQexecParams"/>. Like
<xref linkend="libpq-PQexecParams"/>, it allows only one command in the
query string.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-PQsendPrepare">
<term><function>PQsendPrepare</function><indexterm><primary>PQsendPrepare</primary></indexterm></term>
<listitem>
<para>
Sends a request to create a prepared statement with the given
parameters, without waiting for completion.
<synopsis>
int PQsendPrepare(PGconn *conn,
const char *stmtName,
const char *query,
int nParams,
const Oid *paramTypes);
</synopsis>
This is an asynchronous version of <xref linkend="libpq-PQprepare"/>: it
returns 1 if it was able to dispatch the request, and 0 if not.
After a successful call, call <xref linkend="libpq-PQgetResult"/> to
determine whether the server successfully created the prepared
statement. The function's parameters are handled identically to
<xref linkend="libpq-PQprepare"/>.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-PQsendQueryPrepared">
<term><function>PQsendQueryPrepared</function><indexterm><primary>PQsendQueryPrepared</primary></indexterm></term>
<listitem>
<para>
Sends a request to execute a prepared statement with given
parameters, without waiting for the result(s).
<synopsis>
int PQsendQueryPrepared(PGconn *conn,
const char *stmtName,
int nParams,
const char * const *paramValues,
const int *paramLengths,
const int *paramFormats,
int resultFormat);
</synopsis>
This is similar to <xref linkend="libpq-PQsendQueryParams"/>, but
the command to be executed is specified by naming a
previously-prepared statement, instead of giving a query string.
The function's parameters are handled identically to
<xref linkend="libpq-PQexecPrepared"/>.