Here are several examples that work but the last one fails to compile.
I don't think I'll run into ths in my application but just thought
I'd mention it.
connection C;
work *T;
T = new work(C, "test1");
T->exec("create table x (num numeric)");
T->exec("insert into x (num) values (111)"); // This works.
C.prepare("p1", "insert into x (num) values ($1)")
("varchar", prepare::treat_string);
T->prepared("p1")(222).exec(); // This works.
T->prepared("p1")(222).exec(); // This works.
T->prepared("p1")(222).exec(); // This works.
prepare::invocation Inv = T->prepared("p1");
Inv("333");
Inv.exec(); // This works.
prepare::invocation Inv2 = T->prepared("p1");
Inv2("333");
Inv2.exec(); // This works.
/******
pg_test.C: In member function `pqxx::prepare::invocation&
pqxx::prepare::invocation::operator=(const
pqxx::prepare::invocation&)':
pg_test.C:54: error: non-static reference member
`pqxx::transaction_base&pqxx::prepare::invocation::m_home', can't use
default assignment operator
pg_test.C:54: error: non-static reference member `const
std::string&pqxx::prepare::invocation::m_statement', can't use default
assignment operator
*******/
Inv = T->prepared("p1");
Inv("444");
Inv.exec();
_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general