Overview
Features
Download
Documentation
Community
Add-Ons & Services

[Solved] Poco Data call SQLServer stored Procedure

Please post support and help requests here.

[Solved] Poco Data call SQLServer stored Procedure

Postby YoannBrenet » 23 Nov 2013, 15:49

Hi,

Hi I am using 1.5.2.

I am trying to find examples of how to call SQLServer stored procedures and get data back into a std::vector of std::tuple.

Could anybody help please.

I have as well tried the following but get a static assert error : poco\1.5.2\include\Poco\Data\Binding.h(1413): error C2027: use of undefined type 'POCO_STATIC_ASSERTION_FAILURE<x>' :

Poco::Data::Statement _stored_proc_query(_DBSession);
std::vector<std::string> _result;
_stored_proc_query << "{? = call sp_Test(?)", Poco::Data::Keywords::into(_result), Poco::Data::Keywords::in("someText");

Thanks,
Yoann
Last edited by YoannBrenet on 26 Nov 2013, 14:27, edited 1 time in total.
YoannBrenet
 
Posts: 6
Joined: 22 Nov 2013, 17:12

Re: Poco Data call SQLServer stored Procedure

Postby YoannBrenet » 25 Nov 2013, 10:46

Hi,

I figured it out.
Just in case somebody is looking for the same information:

To call a stored procedure use the following. Do not use std::tuple but Poco::Tuple

std::vector<Poco::Tuple<std::string, std::string>> _test;
std::string _input = "some text";
_DBSession << "{call sp_Test(?)}", Poco::Data::Keywords::into(_test), Poco::Data::Keywords::in(_input), Poco::Data::Keywords::now;

Yoann
YoannBrenet
 
Posts: 6
Joined: 22 Nov 2013, 17:12


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron