The problem is that if you do this you'll access the database twice. I'm trying to do what you told me but only with one access. tks a lot
>From: "Jeroen T. Vermeulen" <[EMAIL PROTECTED]> >To: "Luis Silva" <[EMAIL PROTECTED]> >CC: [email protected] >Subject: Re: [libpqxx-general] transaction >Date: Fri, 6 Jan 2006 10:59:56 +0700 (ICT) > >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 > > _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ Libpqxx-general mailing list [email protected] http://gborg.postgresql.org/mailman/listinfo/libpqxx-general
