9 using namespace oracle::occi;
14 m_writeStmt =
nullptr;
23 this->checkConnection();
26 m_writeStmt = m_conn->createStatement();
29 "INSERT INTO run_pn_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(
"RunPNErrorsDat::prepareWrite(): " + e.getMessage()));
39 this->checkConnection();
42 int iovID = iov->fetchID();
44 throw(std::runtime_error(
"RunPNErrorsDat::writeDB: IOV not in DB"));
47 int logicID = ecid->getLogicID();
49 throw(std::runtime_error(
"RunPNErrorsDat::writeDB: Bad EcalLogicID"));
53 m_writeStmt->setInt(1, iovID);
54 m_writeStmt->setInt(2, logicID);
56 m_writeStmt->executeUpdate();
57 }
catch (SQLException&
e) {
58 throw(std::runtime_error(
"RunPNErrorsDat::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_pn_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, RunPNErrorsDat>
p;
86 while (rset->next()) {
100 }
catch (SQLException&
e) {
101 throw(std::runtime_error(
"RunPNErrorsDat::fetchData(): " + e.getMessage()));
std::string to_string(const V &value)
void prepareWrite() noexcept(false) override
void fetchData(std::map< EcalLogicID, RunPNErrorsDat > *fillMap, RunIOV *iov) noexcept(false)
void setErrorBits(uint64_t bits)
static std::vector< std::string > checklist dat
~RunPNErrorsDat() override
void writeDB(const EcalLogicID *ecid, const RunPNErrorsDat *item, RunIOV *iov) noexcept(false)