159 cout <<
"tag id="<< tagID << endl;
165 cout <<
"mon tag id="<< montagID << endl;
170 int my_min_run=min_run-1;
171 int my_max_run=max_run+1;
173 Statement* stmt0 =
m_conn->createStatement();
174 stmt0->setSQL(
"SELECT count(mon_run_iov.iov_id) FROM mon_run_iov, run_iov " 175 "WHERE mon_run_iov.run_iov_id= run_iov.iov_id " 176 "and run_iov.tag_id = :tag_id and mon_run_iov.tag_id=:montag_id " 177 " and run_iov.run_num> :min_run and run_iov.run_num< :max_run " 179 stmt0->setInt(1, tagID);
180 stmt0->setInt(2, montagID);
181 stmt0->setInt(3, my_min_run);
182 stmt0->setInt(4, my_max_run);
184 ResultSet* rset0 = stmt0->executeQuery();
186 nruns = rset0->getInt(1);
188 m_conn->terminateStatement(stmt0);
190 cout <<
"nruns="<< nruns << endl;
194 Statement* stmt =
m_conn->createStatement();
195 stmt->setSQL(
"SELECT run_iov.run_num, run_iov.run_start, run_iov.run_end, mon_run_iov.tag_id, mon_run_iov.run_iov_id, mon_run_iov.subrun_num, mon_run_iov.subrun_start, mon_run_iov.subrun_end, mon_run_iov.iov_id FROM run_iov, mon_run_iov " 196 "WHERE mon_run_iov.run_iov_id=run_iov.iov_id and run_iov.tag_id = :tag_id " 197 " and mon_run_iov.tag_id=:montag_id " 198 " and run_iov.run_num> :min_run and run_iov.run_num< :max_run " 199 " order by run_iov.run_num, mon_run_iov.subrun_num ASC " );
200 stmt->setInt(1, tagID);
201 stmt->setInt(2, montagID);
202 stmt->setInt(3, my_min_run);
203 stmt->setInt(4, my_max_run);
211 ResultSet* rset = stmt->executeQuery();
215 int runNum = rset->getInt(1);
216 Date startDate = rset->getDate(2);
217 Date endDate = rset->getDate(3);
219 int lid=rset->getInt(5);
220 int subrun=rset->getInt(6);
221 Date monstartDate = rset->getDate(7);
222 Date monendDate = rset->getDate(8);
223 int liov_id=rset->getInt(9);
225 runStart =
dh.dateToTm( startDate );
226 runEnd =
dh.dateToTm( endDate );
227 lrunStart =
dh.dateToTm( monstartDate );
228 lrunEnd =
dh.dateToTm( monendDate );
251 m_conn->terminateStatement(stmt);
252 }
catch (SQLException &
e) {
253 throw(std::runtime_error(
std::string(
"RunIOV::fetchID: ")+getOraMessage(&e)));
int fetchID() noexcept(false) override
oracle::occi::Environment * m_env
void setRunStart(const Tm &start)
oracle::occi::Connection * m_conn
void setRunIOV(const RunIOV &iov)
void setRunTag(const RunTag &tag)
void setRunNumber(run_t run)
void checkConnection() const noexcept(false)
void setSubRunEnd(const Tm &end)
void setSubRunNumber(subrun_t subrun)
void setSubRunStart(const Tm &start)
std::vector< MonRunIOV > m_vec_monruniov
void setMonRunTag(const MonRunTag &tag)
void setRunEnd(const Tm &end)
int fetchID() noexcept(false) override
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)