| 568 | } |
| 569 | |
| 570 | std::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 | |
| 586 | size_t SqlWCharArrLen(const SQLWCHAR* str_val) { |
| 587 | if (!str_val) { |
no test coverage detected