Fetching Blob Data from Selected Rows
Go Up to Reading Data from a Blob
A looping construct is used to fetch (into the output XSQLDA
) the column data for a single row at a time from the select-list and to process each row before the next row is fetched. Each execution of isc_dsql_fetch()
fetches the column data into the corresponding XSQLVAR
substructures of out_sqlda
. For the Blob column, the Blob ID, not the actual Blob data, is fetched.
ISC_STATUS fetch_stat; long SQLCODE; . . . while ((fetch_stat = isc_dsql_fetch(status_vector, &stmt, 1, out_sqlda)) == 0) { proj_name[PROJLEN] = '\0'; prod_type[TYPELEN] = '\0'; printf("\nPROJECT: %–20s TYPE: %–15s\n\n", proj_name, prod_type); /* Read and process the Blob data (see next section) */ } if (fetch_stat != 100L) { /* isc_dsql_fetch returns 100 if no more rows remain to be retrieved */ SQLCODE = isc_sqlcode(status_vector); isc_print_sqlerror(SQLCODE, status_vector); return(1); }