*** libpq.sgml.1~ 2004-10-06 03:30:42.803775731 +0530 --- libpq.sgml 2004-10-06 05:24:22.934466263 +0530 *************** *** 1183,1194 **** ! Presently, prepared statements for use with PQexecPrepared ! must be set up by executing an SQL PREPARE command, ! which is typically sent with PQexec (though any of ! libpq's query-submission functions may be used). ! A lower-level interface for preparing statements may be offered in a ! future release. --- 1183,1238 ---- ! Prepared statements for use with PQexecPrepared can be ! created by executing an SQL PREPARE statement (which is ! sent with PQexec, or one of the other query-submission ! functions), or with PQprepare. The latter does not ! require parameter types to be pre-specified. ! ! ! ! ! ! PQpreparePQprepare ! ! ! Submits a request to create a prepared statement with the ! given parameters, and waits for completion. ! ! PGresult *PQprepare(PGconn *conn, ! const char *stmtName, ! const char *query, ! int nParams, ! const Oid *paramTypes); ! ! ! ! ! PQprepare creates a prepared statement for execution with ! PQexecPrepared. Unlike PREPARE, it allows the ! client to prepare a statement without pre-specifying the types of each ! parameter. This function is supported only in protocol 3.0 and later ! connections; it will fail when using protocol 2.0. ! ! ! ! The function creates a prepared statement named stmtName ! (which may be "", to refer to the unnamed statement) from ! the query. If any parameters are used, they are referred ! to in the query as $1, $2, etc. ! ! nParams is the number of parameters for which types are ! pre-specified in the array paramTypes[]. It may be zero, ! or up to the number of parameters used in the query. Each entry in the ! paramTypes[] array should contain the OID of the type of ! the corresponding parameter. If nParams is 0, the server ! assigns a data type to each parameter, as it would for untyped literal ! strings. Likewise, if any element in the type array is zero, its type ! is inferred. ! ! ! ! *************** *** 2353,2358 **** --- 2397,2423 ---- + PQsendPreparePQsendPrepare + + + Sends a request to create a prepared statement with the given + parameters, without waiting for completion. + + int PQsendPrepare(PGconn *conn, + const char *stmtName, + const char *query, + int nParams, + const Oid *paramTypes); + + + This is an asynchronous version of PQprepare, and + its parameters are handled identically. It will not work on 2.0 + protocol connections. + + + + + PQgetResultPQgetResult