diff -c psqlodbc.orig\execute.c psqlodbc\execute.c *** psqlodbc.orig\execute.c Tue Dec 06 21:53:30 2005 --- psqlodbc\execute.c Fri Dec 16 18:11:16 2005 *************** *** 542,547 **** --- 542,548 ---- UInt4 offset = apdopts->param_offset_ptr ? *apdopts->param_offset_ptr : 0; Int4 bind_size = apdopts->param_bind_type; Int4 current_row = stmt->exec_current_row < 0 ? 0 : stmt->exec_current_row; + SWORD param_count; /* * Increment the number of currently processed rows *************** *** 549,555 **** if (ipdopts->param_processed_ptr) (*ipdopts->param_processed_ptr)++; stmt->data_at_exec = -1; ! for (i = 0; i < apdopts->allocated; i++) { Int4 *pcVal = apdopts->parameters[i].used; --- 550,559 ---- if (ipdopts->param_processed_ptr) (*ipdopts->param_processed_ptr)++; stmt->data_at_exec = -1; ! /* Check bind parameters count */ ! if (SQL_SUCCESS != PGAPI_NumParams(stmt, ¶m_count)) ! return SQL_ERROR; ! for (i = 0; i < param_count; i++) { Int4 *pcVal = apdopts->parameters[i].used; *************** *** 740,750 **** } /* In the middle of SQLParamData/SQLPutData, so cancel that. */ - - /* Free all previous data-at-exec buffers */ - mylog("%s: Clearing parameters et al.\n", func); - - SC_free_params(stmt, STMT_FREE_PARAMS_ALL); stmt->data_at_exec = -1; stmt->current_exec_param = -1; stmt->put_data = FALSE; --- 744,749 ----