Hi everyone! Today’s post will be really short. It’s for those who is looking for this solution in C++ programming.
I have tried to search for this solution online but it wasn’t available. Hence, by using different resources and trail & error, I came up with this solution.
Below is an example of how to convert a wstring variable to an SQLString:
std::wstring wstr = L”hello”;
str = std::string(wstr.begin(), wstr.end());
sqlStr = str;
Initially we have a wstring and we cast it to a string type. Then finally, we uses c_str() to obtain an sql::SQLString.
Hope this will be helpful for those who stumble across this blog while finding for solutions. You may also send me some tips if you like my work and want to see more of such content. Funds will mostly be used for my boba milk tea addiction. The link is here. 🙂