So let's execute an actual query. There is no "query class" in libpqxx™; we really do try to keep your life simple.
A query is executed within a transaction by passing the query string to its exec method. If the query fails to execute properly, this method will throw the appropriate exception.
The query itself is a standard C string, ie. a const char * but you'll frequently want to use a C++ string to make it easy to include variables:
void DeleteEntry(work &T, string Table, long ID) { T.exec("DELETE FROM " + Table + " WHERE ID=" + ID); }