4 print "Cannot import cx_Oracle:", e
8 print '============================================================='
9 print 'run=%s date=[%s] test=%s'%(row[0],row[1],row[2])
10 print 'cand=[%s on %s]'%(row[3],row[4])
13 print '-------------------------------------------------------------'
14 print 'ref=[%s on %s]'%(row[1],row[2])
22 marker =
' <----ERROR'
26 print '%s [%s]=%d %s'%(check,step,code,marker)
34 curs = self.conn.cursor()
35 sqlstr =
"CREATE TABLE RUN_HEADER (RID NUMBER, RDATE DATE, LABEL VARCHAR2(20), "
36 sqlstr +=
"T_RELEASE VARCHAR2(50), T_ARCH VARCHAR2(30), LOG CLOB "
37 sqlstr +=
"CONSTRAINT PK_ID0 PRIMARY KEY(RID))"
40 sqlstr =
"CREATE TABLE RUN_RESULT (ID NUMBER, RID NUMBER, R_RELEASE VARCHAR(50), R_ARCH VARCHAR2(30) "
41 sqlstr +=
"CONSTRAINT PK_ID PRIMARY KEY(ID))"
44 sqlstr =
"CREATE TABLE RUN_STEP_RESULT (ID NUMBER, STEP_LABEL VARCHAR(100), STATUS NUMBER)"
47 sqlstr =
"CREATE SEQUENCE RUN_ID_SEQ INCREMENT BY 1 START WITH 1"
50 sqlstr =
"CREATE SEQUENCE RES_ID_SEQ INCREMENT BY 1 START WITH 1"
54 print 'RESULTS DATABASE CREATED'
57 curs = self.conn.cursor()
58 sqlstr =
"DROP TABLE RUN_HEADER"
61 sqlstr =
"DROP TABLE RUN_RESULT"
64 sqlstr =
"DROP TABLE RUN_STEP_RESULT"
67 sqlstr =
"DROP SEQUENCE RES_ID_SEQ"
71 print 'RESULT DATABASE DROPPED'
74 curs = self.conn.cursor()
75 sqlstr =
"SELECT RID, TO_CHAR(RDATE, 'DD.MM.YYYY HH24:MI:SS'), LABEL, T_RELEASE, T_ARCH "
76 sqlstr +=
"FROM RUN_HEADER ORDER BY RID"
84 curs = self.conn.cursor()
85 sqlstr =
"SELECT ID, R_RELEASE, R_ARCH "
86 sqlstr +=
"FROM RUN_RESULT WHERE RID=:rids ORDER BY ID"
88 curs.execute(sqlstr, rids=rid)
94 curs = self.conn.cursor()
95 sqlstr =
"SELECT STEP_LABEL, STATUS FROM RUN_STEP_RESULT WHERE ID = :ids"
97 curs.execute(sqlstr, ids = id)
103 curs = self.conn.cursor()
104 sqlstr =
"SELECT RID, TO_CHAR(RDATE, 'DD.MM.YYYY HH24:MI:SS'), LABEL, T_RELEASE, T_ARCH, LOG "
105 sqlstr +=
"FROM RUN_HEADER "
108 sqlstr +=
"WHERE RID="+runId
111 if( putAnd ==
True ):
115 sqlstr +=
"LABEL='"+label+
"'"
118 if( putAnd ==
True ):
122 sqlstr +=
"T_RELEASE='"+trel+
"'"
125 if( putAnd ==
True ):
129 sqlstr +=
"T_ARCH='"+tarch+
"'"
131 sqlstr +=
" ORDER BY RID"
145 curs = self.conn.cursor()
146 sqlstr =
"SELECT ID FROM RUN_RESULT WHERE RID = :rids"
148 curs.execute(sqlstr, rids=rid)
151 sqlstr =
"DELETE FROM RUN_RESULT WHERE RID = :rids"
153 curs.execute(sqlstr, rids=rid)
154 sqlstr =
"DELETE FROM RUN_HEADER WHERE RID = :rids"
156 curs.execute(sqlstr, rids=rid)
160 curs = self.conn.cursor()
161 sqlstr =
"DELETE FROM RUN_STEP_RESULT WHERE ID=:ids"
163 curs.execute(sqlstr, ids=id)
166 curs = self.conn.cursor()
167 sqlstr =
"SELECT RID FROM RUN_HEADER WHERE RID = :rid"
169 curs.execute(sqlstr, rid = runID)
173 if( foundRun ==
False ):
174 sqlstr =
"INSERT INTO RUN_HEADER(RID, RDATE, LABEL, T_RELEASE, T_ARCH) VALUES (:rid, :ts, :labl, :trel, :tarc)"
176 curs.execute(sqlstr, rid = runID, ts=timeStamp, labl=match[0], trel = match[1], tarc = match[2])
178 sqlstr =
"INSERT INTO RUN_RESULT(ID, RID, R_RELEASE, R_ARCH)"
179 sqlstr +=
"VALUES(:ids, :rid, :rrel, :rarc)"
181 curs.execute(sqlstr, ids=id, rid = runID, rrel = match[3], rarc = match[4])
183 for i
in range(5, len(match)):
184 if resTags[i-5] !=
"%NONE":
188 curs = self.conn.cursor()
189 sqlstr =
"INSERT INTO RUN_STEP_RESULT(ID, STEP_LABEL, STATUS)"
190 sqlstr +=
"VALUES(:ids, :labl, :stat)"
192 curs.execute(sqlstr, ids=id, labl=step_label, stat = status)
196 curs = self.conn.cursor()
197 sqlstr =
"UPDATE RUN_HEADER SET LOG = :lstr WHERE RID = :rid"
199 curs.execute(sqlstr, lstr = logStr, rid=runID)
203 curs = self.conn.cursor()
204 sqlstr =
"SELECT ID FROM RUN_RESULT WHERE RID=:rid"
206 curs.execute(sqlstr, rid=runID)
208 innercur = self.conn.cursor()
209 isqlstr =
"SELECT STATUS FROM RUN_STEP_RESULT WHERE ID= :ids"
210 innercur.prepare(isqlstr)
211 innercur.execute(isqlstr, ids=row[0])
212 for irow
in innercur:
218 curs = self.conn.cursor()
219 sqlstr =
"SELECT RES_ID_SEQ.NextVal FROM DUAL"
226 curs = self.conn.cursor()
227 sqlstr =
"SELECT RUN_ID_SEQ.NextVal FROM DUAL"
234 curs = self.conn.cursor()
235 sqlstr =
"SELECT SYSTIMESTAMP AS \"NOW\" FROM DUAL"
if(c.getParameter< edm::InputTag >("puppiValueMap").label().size()!=0)