Index: test/test095.cxx =================================================================== --- test/test095.cxx (revision 0) +++ test/test095.cxx (revision 0) @@ -0,0 +1,45 @@ +#include + +#include "test_helpers.hxx" + +using namespace PGSTD; +using namespace pqxx; + + +namespace +{ + +// Simple test program for libpqxx. Open connection to database, start +// a transaction, and perform a query inside it. +void test_095(connection_base &C, transaction_base &trans) +{ + cout << "Connected to database." << endl + << "Backend version: " << C.server_version() << endl + << "Protocol version: " << C.protocol_version() << endl; + + // Close old transaction. + trans.abort(); + + // Create connection + connection conn(conn_str); + + work T(conn, "test1"); + + param_invocation invoc = T.exec_param("SELECT $1::INTEGER, $2::VARCHAR, $3::BOOLEAN"); + + result R( invoc(125)("aaaa")(false).exec() ); + + // Process each successive result tuple + for (result::const_iterator c = R.begin(); c != R.end(); ++c) + { + for(result::tuple::const_iterator it = c->begin(), end = c->end(); it != end; ++it) + cout << '\t' << it->name() << '\t' << it->c_str() << endl; + + } + + T.commit(); +} + +} // namespace + +PQXX_REGISTER_TEST(test_095)