12 using namespace oracle::occi;
32 throw(std::runtime_error)
35 this->checkConnection();
38 int ecid_id=ecid.getLogicID();
41 Statement* stmt0 = m_conn->createStatement();
42 stmt0->setSQL(
"SELECT count(since) FROM PVSS_TEMPERATURE_DAT "
43 "WHERE logic_id = :logic_id " );
44 stmt0->setInt(1, ecid_id);
48 nruns = rset0->getInt(1);
50 m_conn->terminateStatement(stmt0);
52 cout <<
"DCSPTMTempList::fetchValuesForECID>> Number of records in DB="<< nruns << endl;
53 m_vec_temp.reserve(nruns);
55 Statement* stmt = m_conn->createStatement();
56 stmt->setSQL(
"SELECT "
57 "since, till, temperature FROM PVSS_TEMPERATURE_DAT "
58 "WHERE logic_id = :logic_id order by since " );
59 stmt->setInt(1, ecid_id);
70 Date startDate = rset->getDate(1);
71 Date endDate = rset->getDate(2);
72 float x = rset->getFloat(3);
81 m_vec_temp.push_back(r);
86 cout <<
"DCSPTMTempList::fetchValuesForECID>> loop done " << endl;
88 m_conn->terminateStatement(stmt);
90 throw(std::runtime_error(
"DCSPTMTempList: "+e.getMessage()));
97 throw(std::runtime_error)
100 this->checkConnection();
103 int ecid_id=ecid.getLogicID();
111 Statement* stmt0 = m_conn->createStatement();
112 stmt0->setSQL(
"SELECT count(since) FROM PVSS_TEMPERATURE_DAT "
113 "WHERE logic_id = :logic_id "
114 "AND since >= :start_time "
115 "AND since <= :till_time "
117 stmt0->setInt(1, ecid_id);
121 ResultSet* rset0 = stmt0->executeQuery();
123 nruns = rset0->getInt(1);
125 m_conn->terminateStatement(stmt0);
127 cout <<
"DCSPTMTempList::fetchValuesForECIDAndTime>> Number of records in DB="<< nruns << endl;
128 m_vec_temp.reserve(nruns);
130 Statement* stmt = m_conn->createStatement();
131 stmt->setSQL(
"SELECT "
132 "since, till, temperature FROM PVSS_TEMPERATURE_DAT "
133 "WHERE logic_id = :logic_id "
134 "AND since >= :start_time "
135 "AND since <= :till_time "
136 " order by since " );
137 stmt->setInt(1, ecid_id);
147 Date startDate = rset->getDate(1);
148 Date endDate = rset->getDate(2);
149 float x = rset->getFloat(3);
150 runStart = dh.
dateToTm( startDate );
158 m_vec_temp.push_back(r);
164 m_conn->terminateStatement(stmt);
166 throw(std::runtime_error(
"DCSPTMTempList: "+e.getMessage()));
void setEnd(const Tm &end)
void setEcalLogicID(const EcalLogicID &ecid)
void setTemperature(float temp)
tuple start
Check for commandline option errors.
oracle::occi::SQLException SQLException
oracle::occi::Date tmToDate(const Tm &inTm) const
oracle::occi::ResultSet ResultSet
void fetchValuesForECIDAndTime(const EcalLogicID &ecid, const Tm &start, const Tm &end)
std::vector< DCSPTMTemp > getList()
Tm dateToTm(oracle::occi::Date &date) const
void fetchValuesForECID(const EcalLogicID &ecid)
void setStart(const Tm &start)