9 using namespace oracle::occi;
14 m_writeStmt =
nullptr;
23 this->checkConnection();
26 m_writeStmt = m_conn->createStatement();
29 "INSERT INTO run_tt_errors_dat (iov_id, logic_id, "
31 "VALUES (:iov_id, :logic_id, "
32 "to_number(:error_bits))");
33 }
catch (SQLException&
e) {
34 throw(std::runtime_error(
"RunTTErrorsDat::prepareWrite(): " + e.getMessage()));
39 this->checkConnection();
42 int iovID = iov->fetchID();
44 throw(std::runtime_error(
"RunTTErrorsDat::writeDB: IOV not in DB"));
47 int logicID = ecid->getLogicID();
49 throw(std::runtime_error(
"RunTTErrorsDat::writeDB: Bad EcalLogicID"));
53 m_writeStmt->setInt(1, iovID);
54 m_writeStmt->setInt(2, logicID);
55 m_writeStmt->setString(3, std::to_string(
item->getErrorBits()));
56 m_writeStmt->executeUpdate();
57 }
catch (SQLException&
e) {
58 throw(std::runtime_error(
"RunTTErrorsDat::writeDB(): " + e.getMessage()));
63 this->checkConnection();
66 iov->setConnection(m_env, m_conn);
67 int iovID = iov->fetchID();
76 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
77 "to_char(d.error_bits) "
78 "FROM channelview cv JOIN run_tt_errors_dat d "
79 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
80 "WHERE d.iov_id = :iov_id");
81 m_readStmt->setInt(1, iovID);
82 ResultSet* rset = m_readStmt->executeQuery();
84 std::pair<EcalLogicID, RunTTErrorsDat>
p;
86 while (rset->next()) {
100 }
catch (SQLException&
e) {
101 throw(std::runtime_error(
"RunTTErrorsDat::fetchData(): " + e.getMessage()));
~RunTTErrorsDat() override
void setErrorBits(uint64_t bits)
void writeDB(const EcalLogicID *ecid, const RunTTErrorsDat *item, RunIOV *iov) noexcept(false)
void fetchData(std::map< EcalLogicID, RunTTErrorsDat > *fillMap, RunIOV *iov) noexcept(false)
static std::vector< std::string > checklist dat
void prepareWrite() noexcept(false) override