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

Function GetStringColumnW

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

Source from the content-addressed store, hash-verified

495}
496
497std::wstring GetStringColumnW(SQLHSTMT stmt, int col_id) {
498 SQLWCHAR buf[1024];
499 SQLLEN len_indicator = 0;
500
501 EXPECT_EQ(SQL_SUCCESS,
502 SQLGetData(stmt, col_id, SQL_C_WCHAR, buf, sizeof(buf), &len_indicator));
503
504 if (len_indicator == SQL_NULL_DATA) {
505 return L"";
506 }
507
508 // indicator is in bytes, so convert to character count
509 size_t char_count = static_cast<size_t>(len_indicator) / GetSqlWCharSize();
510 return std::wstring(buf, buf + char_count);
511}
512
513std::wstring ConvertToWString(const std::vector<SQLWCHAR>& str_val, SQLSMALLINT str_len) {
514 std::wstring attr_str;

Callers 1

TEST_FFunction · 0.85

Calls 2

GetSqlWCharSizeFunction · 0.85
SQLGetDataFunction · 0.50

Tested by

no test coverage detected