Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is most efficient way to execute ODBC stored procedure? #1075

Open
dezmen3 opened this issue Sep 1, 2023 · 0 comments
Open

What is most efficient way to execute ODBC stored procedure? #1075

dezmen3 opened this issue Sep 1, 2023 · 0 comments

Comments

@dezmen3
Copy link

dezmen3 commented Sep 1, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant