And the version like this, isn't working either:
sql.once << "....";
if(!sql.got_data())
{
 /// throws
}


2013/6/26 Nicolas Deroche <[email protected]>

>
> Well using the fetch function right after execute is not working either
>
> dbs::Server* server = new dbs::Server();
> soci::statement st =
> (sql.prepare << "SELECT linkname, name, engine, listening_ip,
> listening_port, auth_id, auth_pw, max_clients, parent_linkname, childs, id
> FROM `" << Server::table_name << "` WHERE `linkname`=':ii'",
> soci::use(linkname, "ii"),
> soci::into(server->linkname),
> soci::into(server->name),
> soci::into(server->engine_type),
> soci::into(server->listening_ip),
> soci::into(server->listening_port),
> soci::into(server->auth_id),
> soci::into(server->auth_pw),
> soci::into(server->max_clients),
> soci::into(server->parent_linkname),
> soci::into(server->childs),
> soci::into(server->id));
> *st.execute();
> st.fetch();
>
> if(!st.got_data())
> {
> std::cout << "SQL = SELECT linkname, name, engine, listening_ip,
> listening_port, auth_id, auth_pw, max_clients, parent_linkname, childs, id
> FROM `" << Server::table_name << "` WHERE `linkname`='" << linkname << "'"
> << std::endl;
> delete server;
> throw Server::does_not_exist();
> *
> }
> else
> {
> Server::gets().insert({server->linkname, server});
> server->init_load();
> return *server;
> }
>
>
> 2013/6/26 Mateusz Loskot <[email protected]>
>
>> On 26 June 2013 15:02, Nicolas Deroche <[email protected]> wrote:
>> > The query should return only one row, is t really necessary ?
>> >
>>
>> Please, check the docs. It's all there what calls are necessary.
>>
>> Best regards,
>> --
>> Mateusz  Loskot, http://mateusz.loskot.net
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Windows:
>>
>> Build for Windows Store.
>>
>> http://p.sf.net/sfu/windows-dev2dev
>> _______________________________________________
>> soci-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/soci-users
>>
>
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to