MCPcopy Create free account
hub / github.com/apache/arrow / SQLFetch

Function SQLFetch

cpp/src/arrow/flight/sql/odbc/odbc_api.cc:1086–1106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1084}
1085
1086SQLRETURN SQLFetch(SQLHSTMT stmt) {
1087 ARROW_LOG(DEBUG) << "SQLFetch called with stmt: " << stmt;
1088
1089 using ODBC::ODBCDescriptor;
1090 using ODBC::ODBCStatement;
1091 return ODBCStatement::ExecuteWithDiagnostics(stmt, SQL_ERROR, [=]() {
1092 ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt);
1093
1094 // The SQL_ATTR_ROW_ARRAY_SIZE statement attribute specifies the number of rows in the
1095 // rowset. Retrieve it with GetArraySize.
1096 ODBCDescriptor* ard = statement->GetARD();
1097 size_t rows = static_cast<size_t>(ard->GetArraySize());
1098
1099 if (statement->Fetch(rows)) {
1100 return SQL_SUCCESS;
1101 } else {
1102 // Reached the end of rowset
1103 return SQL_NO_DATA;
1104 }
1105 });
1106}
1107
1108SQLRETURN SQLExtendedFetch(SQLHSTMT stmt, SQLUSMALLINT fetch_orientation,
1109 SQLLEN fetch_offset, SQLULEN* row_count_ptr,

Callers 14

GetSQLColAttributeStringFunction · 0.50
TEST_FFunction · 0.50
TYPED_TESTFunction · 0.50
TEST_FFunction · 0.50
TYPED_TESTFunction · 0.50
TEST_FFunction · 0.50
TYPED_TESTFunction · 0.50
ValidateFetchFunction · 0.50
TEST_FFunction · 0.50

Calls 3

GetARDMethod · 0.80
GetArraySizeMethod · 0.80
FetchMethod · 0.80

Tested by 14

GetSQLColAttributeStringFunction · 0.40
TEST_FFunction · 0.40
TYPED_TESTFunction · 0.40
TEST_FFunction · 0.40
TYPED_TESTFunction · 0.40
TEST_FFunction · 0.40
TYPED_TESTFunction · 0.40
ValidateFetchFunction · 0.40
TEST_FFunction · 0.40