| 495 | } |
| 496 | |
| 497 | std::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 | |
| 513 | std::wstring ConvertToWString(const std::vector<SQLWCHAR>& str_val, SQLSMALLINT str_len) { |
| 514 | std::wstring attr_str; |
no test coverage detected