Skip site navigation (1) Skip section navigation (2)

C++ usage question

From: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: C++ usage question
Date: 2001-05-25 16:24:36
Message-ID: 20010525172436.A11785@quartz.newn.cam.ac.uk (view raw or flat)
Thread:
Lists: pgsql-interfaces
Within a C++ program I essentially do

PgDatabase db ("dbname=sameone")
PgDatabase db2("dbname=sameone")

db.Exec("BEGIN")
db.Exec(select)
loop over db.Tuples()
  db2.Exec(query involving results from db)
  do stuff with db2 result

db.Exec("COMMIT")

1) Is the way to keep to results really to have 2 PgDatabase, or is there a
   simple way of saving the result set before having it replaced by the next
   query?

2) Does that BEGIN/COMMIT just apply to the queries in db, the db2 queries
   each automatically having their own transaction?

I know I can experiment to find out, but maybe one of you already knows the
answer...

Cheers,

Patrick

Responses

pgsql-interfaces by date

Next:From: J. T. VermeulenDate: 2001-05-25 16:33:08
Subject: Re: libpq++ and strings.
Previous:From: Oleg BartunovDate: 2001-05-24 16:54:11
Subject: Re: DBD::Pg or DBI breakage?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group