"Jay G. Scott" <gl@arlut.utexas.edu> writes:
> igot = PQsendQuery(conn_to_db,select_stmt);
> fprintf(stderr,"igot from query is %d\n", igot );
> seek_m_id = PQgetResult(conn_to_db); <<<<<<<<<<<<<<<<<<<<<<<<
> estgot = PQresultStatus( seek_m_id );
> fprintf(stderr,"estgot from PQgetResult is %d\n", estgot );
> while( seek_m_id != NULL )
> {
> fprintf(stderr,"seek_m_id != NULL\n");
> seek_m_id = PQgetResult(conn_to_db); <<<<<<<<<<<<<<<<<<<<<<<<
> estgot = PQresultStatus( seek_m_id );
> tmwh( estgot );
> /* i suppose nrows could keep coming back as 1 */
> nrows = PQntuples( seek_m_id );
You did too many PQgetResult's. I'd suggest coding like
while ((seek_m_id = PQgetResult(conn_to_db)) != NULL)
{
... process seek_m_id ...
PQclear(seek_m_id);
}
so that there's only one PQgetResult call.
regards, tom lane