Get Data All (Results Menu)

The Get Data All function tool attempts to retrieve and display the data in every row and column in the result set on the current statement handle. The Get Data All function tool may not be able to display data for bound columns or columns that occur before the last bound column. This tool performs the following actions:

  1. Calls SQLGetFunctions to determine if the driver supports SQLMoreResults.

  2. Calls SQLNumResultCols.

  3. If the statement does not return a result set (the number of rows returned by SQLNumResultCol is 0), it calls SQLRowCount, and displays the number of rows affected by the insert, update, delete, or other statement. Skip to step 8.

  4. If the statement returns a result set, it calls SQLDescribeCol to retrieve the name and column size of each column in the result set. Based on the column size, it allocates an output buffer of up to 65,535 bytes for each column.

  5. Calls SQLFetch.

  6. Calls SQLGetData for each column in the result set with a TargetType argument of SQL_C_CHAR. The Get Data All function tool calls SQLGetData only once for each column. If the data is longer than 65,535 bytes, <trunc> is displayed before the first byte of data in the buffer.

  7. If SQL_ATTR_ROW_ARRAY_SIZE is greater than 1, it calls SQLSetPos to position to the next row in the rowset.

  8. Repeats steps 4 through 6 until SQLFetch returns SQL_NO_DATA.

  9. If the driver supports it, it calls SQLMoreResults. If SQLMoreResults returns SQL_SUCCESS or SQL_SUCCESS_WITH_INFO, the Get Data All function tool returns to step 2. Otherwise, it calls SQLFreeStmt with Option set to SQL_CLOSE to clear the result set.