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

Function GetStringColumnW

cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc:570–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570std::wstring GetStringColumnW(SQLHSTMT stmt, int col_id) {
571 SQLWCHAR buf[1024];
572 SQLLEN len_indicator = 0;
573
574 EXPECT_EQ(SQL_SUCCESS,
575 SQLGetData(stmt, col_id, SQL_C_WCHAR, buf, sizeof(buf), &len_indicator));
576
577 if (len_indicator == SQL_NULL_DATA) {
578 return L"";
579 }
580
581 // indicator is in bytes, so convert to character count
582 size_t char_count = static_cast<size_t>(len_indicator) / GetSqlWCharSize();
583 return std::wstring(buf, buf + char_count);
584}
585
586size_t SqlWCharArrLen(const SQLWCHAR* str_val) {
587 if (!str_val) {

Callers 1

TEST_FFunction · 0.85

Calls 2

GetSqlWCharSizeFunction · 0.85
SQLGetDataFunction · 0.50

Tested by

no test coverage detected