// Copyright (c) 2000-2001 David Muse // See the file COPYING for more information #include "../../config.h" #include #include #include #include #include #include #include #define FETCH_AT_ONCE 10 #define MAX_SELECT_LIST_SIZE 256 #define MAX_ITEM_BUFFER_SIZE 4096 #ifdef HAVE_UNIXODBC char field[MAX_SELECT_LIST_SIZE] [FETCH_AT_ONCE][MAX_ITEM_BUFFER_SIZE]; SQLINTEGER indicator[MAX_SELECT_LIST_SIZE][FETCH_AT_ONCE]; #else char field[MAX_SELECT_LIST_SIZE][MAX_ITEM_BUFFER_SIZE]; SQLINTEGER indicator[MAX_SELECT_LIST_SIZE]; #endif int main(int argc, char **argv) { if (argc<4) { printf("usage: odbctest dsn query iterations\n"); exit(0); } char *dsn=argv[1]; char *query=argv[2]; int iterations=atoi(argv[3]); int length=strlen(query); SQLHENV env; SQLHDBC dbc; SQLHSTMT stmt; SQLSMALLINT ncols; // init the timer time_t starttime=time(NULL); clock(); for (int count=0; count