135 cout <<
"tag id=" << tagID << endl;
141 cout <<
"mon tag id=" << montagID << endl;
146 int my_min_run = min_run - 1;
147 int my_max_run = max_run + 1;
149 Statement* stmt0 =
m_conn->createStatement();
151 "SELECT count(mon_run_iov.iov_id) FROM mon_run_iov, run_iov "
152 "WHERE mon_run_iov.run_iov_id= run_iov.iov_id "
153 "and run_iov.tag_id = :tag_id and mon_run_iov.tag_id=:montag_id "
154 " and run_iov.run_num> :min_run and run_iov.run_num< :max_run ");
155 stmt0->setInt(1, tagID);
156 stmt0->setInt(2, montagID);
157 stmt0->setInt(3, my_min_run);
158 stmt0->setInt(4, my_max_run);
160 ResultSet* rset0 = stmt0->executeQuery();
162 nruns = rset0->getInt(1);
164 m_conn->terminateStatement(stmt0);
166 cout <<
"nruns=" << nruns << endl;
170 Statement* stmt =
m_conn->createStatement();
172 "SELECT run_iov.run_num, run_iov.run_start, run_iov.run_end, mon_run_iov.tag_id, mon_run_iov.run_iov_id, "
173 "mon_run_iov.subrun_num, mon_run_iov.subrun_start, mon_run_iov.subrun_end, mon_run_iov.iov_id FROM run_iov, "
175 "WHERE mon_run_iov.run_iov_id=run_iov.iov_id and run_iov.tag_id = :tag_id "
176 " and mon_run_iov.tag_id=:montag_id "
177 " and run_iov.run_num> :min_run and run_iov.run_num< :max_run "
178 " order by run_iov.run_num, mon_run_iov.subrun_num ASC ");
179 stmt->setInt(1, tagID);
180 stmt->setInt(2, montagID);
181 stmt->setInt(3, my_min_run);
182 stmt->setInt(4, my_max_run);
190 ResultSet* rset = stmt->executeQuery();
194 int runNum = rset->getInt(1);
195 Date startDate = rset->getDate(2);
196 Date endDate = rset->getDate(3);
198 int lid = rset->getInt(5);
199 int subrun = rset->getInt(6);
200 Date monstartDate = rset->getDate(7);
201 Date monendDate = rset->getDate(8);
202 int liov_id = rset->getInt(9);
204 runStart =
dh.dateToTm(startDate);
205 runEnd =
dh.dateToTm(endDate);
206 lrunStart =
dh.dateToTm(monstartDate);
207 lrunEnd =
dh.dateToTm(monendDate);
211 r.setRunStart(runStart);
229 m_conn->terminateStatement(stmt);
230 }
catch (SQLException&
e) {
231 throw(std::runtime_error(
"RunIOV::fetchID: " +
e.getMessage()));