| 544 | } |
| 545 | |
| 546 | std::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 | |
| 562 | size_t SqlWCharArrLen(const SQLWCHAR* str_val) { |
| 563 | if (!str_val) { |
no test coverage detected