* PQprepare * Creates a prepared statement by issuing a Parse message. * * If the query was not even sent, return NULL; conn->errorMessage is set to * a relevant message. * If the query was sent, a new PGresult is returned (which could indicate * either success or failure). * The user is responsible for freeing the PGresult via PQclear() * when done with it. */
| 2273 | * when done with it. |
| 2274 | */ |
| 2275 | PGresult * |
| 2276 | PQprepare(PGconn *conn, |
| 2277 | const char *stmtName, const char *query, |
| 2278 | int nParams, const Oid *paramTypes) |
| 2279 | { |
| 2280 | if (!PQexecStart(conn)) |
| 2281 | return NULL; |
| 2282 | if (!PQsendPrepare(conn, stmtName, query, nParams, paramTypes)) |
| 2283 | return NULL; |
| 2284 | return PQexecFinish(conn); |
| 2285 | } |
| 2286 | |
| 2287 | /* |
| 2288 | * PQexecPrepared |