On 26 June 2013 15:05, Nicolas Deroche <[email protected]> wrote:
>
> 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'",
-------------------------------------------------------------------------------------^^^^^^^^^^^^

You should not need to single-quote the placeholders as in ':ii'
soci::use(linkname, "ii").
Try with simple linkname=:ii


> st.execute();
> st.fetch();
>
> if(!st.got_data())
> {

Just if (!st.fetch()) is enough.

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

Reply via email to