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

Function GetStringColumnW

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

Source from the content-addressed store, hash-verified

544}
545
546std::wstring GetStringColumnW(SQLHSTMT stmt, int col_id) {
547 SQLWCHAR buf[1024];
548 SQLLEN len_indicator = 0;
549
550 EXPECT_EQ(SQL_SUCCESS,
551 SQLGetData(stmt, col_id, SQL_C_WCHAR, buf, sizeof(buf), &len_indicator));
552
553 if (len_indicator == SQL_NULL_DATA) {
554 return L"";
555 }
556
557 // indicator is in bytes, so convert to character count
558 size_t char_count = static_cast<size_t>(len_indicator) / GetSqlWCharSize();
559 return std::wstring(buf, buf + char_count);
560}
561
562size_t SqlWCharArrLen(const SQLWCHAR* str_val) {
563 if (!str_val) {

Callers 1

TEST_FFunction · 0.85

Calls 2

GetSqlWCharSizeFunction · 0.85
SQLGetDataFunction · 0.50

Tested by

no test coverage detected