What is most efficient way to execute ODBC stored procedure?
Opened this issue · 0 comments
dezmen3 commented
What is most efficient way to execute ODBC stored procedure?
Currently I'm using this way:
char szQuery[512]{};
uint32_t nID = 5316;
sprintf_s(szQuery, "{CALL pSelect_Data(%d)}", nID );
soci::rowset<soci::row> rs = (pDB->prepare << szQuery);
for (soci::rowset<soci::row>::const_iterator it = rs.begin(); it != rs.end(); ++it)
{
//do something with row result like soci::row const& row = *it;
}
This was the only way for me to run stored procedure and get some results instead of dropping into soci_error exception. But the reason I ask - sometimes when I call procedure it can actually give me empty result, while it shouldn't. It happens very randomly, can be at any point, like after few minutes, hours of looping on remote application.