Re: URGENT : free result (libpq++ API)
От | Stephan Szabo |
---|---|
Тема | Re: URGENT : free result (libpq++ API) |
Дата | |
Msg-id | 20030820230649.P33044-100000@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | URGENT : free result (libpq++ API) ("Anagha Joshi" <ajoshi@nulinkinc.com>) |
Список | pgsql-admin |
On Thu, 21 Aug 2003, Anagha Joshi wrote: > Hi all, > I'm using PG - 7.2.4 on Solaries. > I'm using "libpq++" library as client implementation is coded in "C++". > > I'm doing the following : > 1. Making the connection to database by creating new object of > "PgDatabase" i.e. > data = new PgDatabase( " CONNECTION INFO "); > > 2. Then I execure the query with: > int return = data->Exec( " THIS IS A SQL QUERY"); > > My question is , > How should I clear(free) the result of the query? Need I close the > connection after each query to do that? It looks to me that PgConnection::Exec clears an existing query result when it's called. // PgConnection::exec -- send a query to the backend ExecStatusType PgConnection::Exec(const char* query) { // Clear the result stucture if needed if (pgResult) PQclear(pgResult); // Execute the given query pgResult = PQexec(pgConn, query); // Return the status if (pgResult) return PQresultStatus(pgResult); else return PGRES_FATAL_ERROR; }
В списке pgsql-admin по дате отправления: