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:
-
Calls SQLGetFunctions to determine if the driver supports SQLMoreResults.
-
Calls SQLNumResultCols.
-
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.
-
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.
-
Calls SQLFetch.
-
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.
-
If SQL_ATTR_ROW_ARRAY_SIZE is greater than 1, it calls SQLSetPos to position to the next row in the rowset.
-
Repeats steps 4 through 6 until SQLFetch returns SQL_NO_DATA.
-
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.