Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtv committed Feb 5, 2020
1 parent 647272c commit 77d2347
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,24 +303,24 @@ int main()
{
pqxx::connection C;
std::cout << "Connected to " << C.dbname() << std::endl;
pqxx::work W(C);
pqxx::work W{C};

pqxx::result R = W.exec("SELECT name FROM employee");
pqxx::result R{W.exec("SELECT name FROM employee")};

std::cout << "Found " << R.size() << "employees:" << std::endl;
std::cout << "Found " << R.size() << "employees:\n";
for (auto row: R)
std::cout << row[0].c_str() << std::endl;
std::cout << row[0].c_str() << '\n';

std::cout << "Doubling all employees' salaries..." << std::endl;
W.exec("UPDATE employee SET salary = salary*2");
std::cout << "Doubling all employees' salaries...\n";
W.exec0("UPDATE employee SET salary = salary*2");

std::cout << "Making changes definite: ";
W.commit();
std::cout << "OK." << std::endl;
std::cout << "OK.\n";
}
catch (const std::exception &e)
catch (std::exception const &e)
{
std::cerr << e.what() << std::endl;
std::cerr << e.what() << '\n';
return 1;
}
return 0;
Expand Down

0 comments on commit 77d2347

Please sign in to comment.