diff -c psqlodbc.orig\convert.c psqlodbc\convert.c *** psqlodbc.orig\convert.c Wed Nov 30 13:44:14 2005 --- psqlodbc\convert.c Mon Dec 05 17:17:11 2005 *************** *** 1860,1873 **** } if (marker_count > 0) { ! CVT_APPEND_CHAR(qb, '('); ! for (i = 0; i < marker_count; i++) { ! if (i > 0) ! CVT_APPEND_STR(qb, ", "); ! CVT_APPEND_STR(qb, pgtype_to_name(stmt, ipdopts->parameters[i].PGType)); } - CVT_APPEND_CHAR(qb, ')'); } CVT_APPEND_STR(qb, " as "); for (qp->opos = 0; qp->opos < qp->stmt_len; qp->opos++) --- 1860,1883 ---- } if (marker_count > 0) { ! if (ipdopts && (ipdopts->allocated == marker_count)) { ! CVT_APPEND_CHAR(qb, '('); ! for (i = 0; i < marker_count; i++) ! { ! if (i > 0) ! CVT_APPEND_STR(qb, ", "); ! CVT_APPEND_STR(qb, pgtype_to_name(stmt, ipdopts->parameters[i].PGType)); ! } ! CVT_APPEND_CHAR(qb, ')'); ! } ! else ! { ! SC_set_error(stmt, STMT_COUNT_FIELD_INCORRECT, "The # of binded parameters < the # of parameter markers"); ! SC_set_sqlstate(stmt, "07002"); ! QB_Destructor(qb); ! return SQL_ERROR; } } CVT_APPEND_STR(qb, " as "); for (qp->opos = 0; qp->opos < qp->stmt_len; qp->opos++)