On Thu, January 5, 2006 23:39, Luis Silva wrote:
> I there, is it possible to send a undefine number of queries (SELECTS)
> with
> transactions, and if one of then doesn't return anything do rollback and
> do
> not commit? if not, is there another tool that does that.

Seems pretty trivial.  What exactly is it that's giving you trouble?

What you're asking for seems to be something like:

bool do_queries(pqxx::connection_base &C)
{
  work W;
  result r;

  r = W.exec(query1);
  if (r.empty()) return false;
  process_result_of_query1(r);

  r = W.exec(query2);
  if (r.empty()) return false;
  process_result_of_query2(r);

  // ...

  W.commit();
  return true;
}



> I need to get the result of the COMMIT. thanks in advance

What do you mean by the result of the COMMIT?  A commit either succeeds or
fails.  If it fails, an exception is thrown.  There is no result in the
usual sense.


Jeroen


_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to