mi_next_row() problem
Posted in 2000
Topics: General Discussion
Hello all, I have a short passage from a test program here: > /* get the row descriptor */ > rowdesc = mi_get_row_desc_without_row(conn); > > /* get the numbr of columns in the row */ > numcols = mi_column_count(rowdesc); > > /* print the column names */ > for (i = 0; i < numcols; i++) > { > colname = mi_column_name(rowdesc, i); > fprintf(stderr, "%s\\t", colname); > } > fprintf(stderr, "\\n\\n"); > > > /* for each row */ > while ( (row = mi_next_row(conn, &error)) != NULL ) > { > // for each column > for (i = 0; i< numcols; i++) > { > // put the column value in colval > switch( mi_value(row, i, &colval, &collen) ) > { > case MI_ERROR: > fprintf(stderr, "\\ncannot get value\\n"); > return(-1); > case MI_NULL_VALUE: > colval = "NULL"; > break; > case MI_NORMAL_VALUE: > // print the column value > mi_db_error_raise( conn, MI_MESSAGE, "%S\\t", colval); > fprintf(stderr, "##=%s\\t", colval); > break; > default: > fprintf(stderr, "\\nunknown value\\n"); > return(-1); > } > } > fprintf(stderr, "\\n"); > > } > The loop just does not terminate, and I have no idea why??? I have only three records in my table, with last one being outputted in a endless loop. Is this a known beginner's problem? Or is there someone, who can send me a working example? Many thanks, Sven