File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,19 +47,20 @@ statement.set(0, 42);
4747* /
4848
4949// Execute and get results
50- statement.execute(transaction);
51-
52- // Process results...
53- do
50+ if (statement.execute(transaction))
5451{
55- const std::optional<std::int32_t> id = statement.getInt32(0);
56- const std::optional<std::string> name = statement.getString(1);
57-
58- /* Or
59- const auto id = statement.get<std::int32_t>(0);
60- const auto name = statement.get<std::string>(1);
61- */
62- } while (statement.fetchNext());
52+ // Process results...
53+ do
54+ {
55+ const std::optional<std::int32_t> id = statement.getInt32(0);
56+ const std::optional<std::string> name = statement.getString(1);
57+
58+ /* Or
59+ const auto id = statement.get<std::int32_t>(0);
60+ const auto name = statement.get<std::string>(1);
61+ */
62+ } while (statement.fetchNext());
63+ }
6364
6465// Commit transaction
6566transaction.commit();
Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ namespace fbcpp
340340 // /
341341 // / @brief Executes a prepared statement using the supplied transaction.
342342 // / @param transaction Transaction that will own the execution context.
343- // / @return `true` when execution yields a result set that can be fetched .
343+ // / @return `true` when execution yields a record .
344344 // /
345345 bool execute (Transaction& transaction);
346346
You can’t perform that action at this time.
0 commit comments