diff -c psqlodbc.orig\statement.c psqlodbc\statement.c *** psqlodbc.orig\statement.c Wed Nov 30 13:44:37 2005 --- psqlodbc\statement.c Fri Dec 09 15:55:58 2005 *************** *** 242,250 **** --- 242,252 ---- { StatementClass *rv; + mylog("SC_Constructor: entering ...\n"); rv = (StatementClass *) malloc(sizeof(StatementClass)); if (rv) { + mylog("SC_Constructor: created stmt = %u\n",rv); rv->hdbc = NULL; /* no connection associated yet */ rv->phstmt = NULL; rv->result = NULL; *************** *** 974,979 **** --- 976,982 ---- if ((((self->currTuple + 1) % ci->drivers.fetch_max) >= QR_get_num_total_tuples(res)) && QR_get_num_total_tuples(res) < ci->drivers.fetch_max) { + SC_no_fetchcursor(self); self->currTuple = QR_get_num_total_tuples(res); return SQL_NO_DATA_FOUND; }