8 #include <soci/mysql/soci-mysql.h>
33 ioSelectStatement = (ioSociSession.prepare
34 <<
"select iata_code, name "
35 <<
"from airlines ", soci::into (ioAirline));
38 ioSelectStatement.execute();
40 }
catch (std::exception
const& lException) {
46 void DBManagerForAirlines::
47 prepareSelectOnAirlineCodeStatement (
DBSession_T& ioSociSession,
61 ioSelectStatement = (ioSociSession.prepare
62 <<
"select iata_code, name "
64 <<
"where iata_code = :airline_code ",
65 soci::into (ioAirline), soci::use (iAirlineCode));
68 ioSelectStatement.execute();
70 }
catch (std::exception
const& lException) {
71 throw SQLDatabaseException (lException.what());
79 bool hasStillData =
false;
84 hasStillData = ioStatement.fetch();
86 }
catch (std::exception
const& lException) {
98 ioSociSession.begin();
108 (ioSociSession.prepare
109 <<
"update airlines "
110 <<
"set name = :name "
111 <<
"where iata_code = :iata_code",
112 soci::use (lAirlineName), soci::use (lAirlineCode));
115 lUpdateStatement.execute (
true);
118 ioSociSession.commit();
123 }
catch (std::exception
const& lException) {
132 bool oHasRetrievedAirline =
false;
137 prepareSelectOnAirlineCodeStatement (ioSociSession, lSelectStatement,
138 iAirlineCode, ioAirline);
142 if (hasStillData ==
true) {
143 oHasRetrievedAirline =
true;
153 }
catch (std::exception
const& lException) {
157 return oHasRetrievedAirline;