- Timestamp:
- Jul 28, 2014, 6:20:27 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140717/ippToPsps
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
jython/ipptopspsdb.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140717/ippToPsps
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20140717/ippToPsps/jython/ipptopspsdb.py
r36815 r37129 786 786 and not self.consistentlyFailed(batchType, stageID)): 787 787 788 self.logger.infoPair("heather:","passed logic")788 # self.logger.infoPair("heather:","passed logic") 789 789 790 790 sql = "INSERT INTO batch ( \ … … 803 803 '" + self.skychunk.name + "' \ 804 804 )" 805 self.logger.infoPair("heather:","sql") 805 806 # self.logger.infoPair("heather:",sql) 806 807 807 808 self.execute(sql) … … 816 817 except: 817 818 self.logger.exception("Unable to get batch ID") 819 self.logger.infoPair("sql:",sql) 820 818 821 batchID = -1 819 822 … … 1017 1020 response = raw_input(" * Name for new skychunk, or existing skychunk to edit? ") 1018 1021 if response == "": return 1022 response = response.strip() 1019 1023 self.skychunk.name = response 1020 1024 … … 1056 1060 question = question + "? " 1057 1061 response = raw_input(question) 1062 response = response.strip() 1063 print "response: '" + response + "'" 1058 1064 if response != "": 1059 1065 if type.find("varchar") != -1 or type.find("timestamp") != -1: quotes = "'" 1060 1066 else: quotes = "" 1067 # print "UPDATE skychunk SET " + field + " = " + quotes + response + quotes + " WHERE name = '" + self.skychunk.name + "'" 1061 1068 self.execute("UPDATE skychunk SET " + field + " = " + quotes + response + quotes + " WHERE name = '" + self.skychunk.name + "'") 1062 1069 … … 1130 1137 self.skychunk.batchTypes = [] 1131 1138 try: 1139 # print "sql: " + sql 1132 1140 rs = self.executeQuery(sql) 1133 1141 … … 1176 1184 if rs.getInt(26) == 1: self.skychunk.parallel = True 1177 1185 self.skychunk.P2_smf_version = rs.getString(27) 1186 # options: "use_new", "not_reproc", "use_original" 1187 1178 1188 self.skychunk.ST_cmf_version = rs.getString(28) 1189 # options: not used? 1190 1191 # NOTE : the rs (ResultSet) class is somewhat annoying and finicky esp about timestamp values 1192 # for example, rs.getTimestamp(N) fails silently if the value is not a valid time. this is 1193 # also true to getString() on the same column. Docs for the ResultSet class can be found here: 1194 # http://docs.oracle.com/javase/1.5.0/docs/api/java/sql/ResultSet.html?is-external=true 1195 1196 # rsmd = rs.getMetaData() 1197 # print "got metadata" 1198 # print "number of columns: " + str(rsmd.getColumnCount()) 1199 # print "label: " + rsmd.getColumnLabel(25) 1200 # print "label: " + rsmd.getColumnLabel(29) 1201 # print "name: " + rsmd.getColumnName(25) 1202 # print "name: " + rsmd.getColumnName(29) 1203 # print "typename: " + rsmd.getColumnTypeName(25) 1204 # print "typename: " + rsmd.getColumnTypeName(29) 1205 1206 # epochStamp = rs.getTimestamp(16) 1207 # print "epoch: " + epochStamp.toString() 1208 1209 # print "label: " + rsmd.getColumnLabel(16) 1210 # print "name: " + rsmd.getColumnName(16) 1211 # print "typename: " + rsmd.getColumnTypeName(16) 1212 1179 1213 self.skychunk.trange_start = rs.getString(29) 1214 # options: "YYYY-MM-DD,HH:MM:SS" or "0000-00-00 00:00:00" 1215 1180 1216 self.skychunk.trange_end = rs.getString(30) 1217 # options: "YYYY-MM-DD,HH:MM:SS" or "0000-00-00 00:00:00" 1181 1218 1182 1219 if self.skychunk.parallel: print "USING parallel" … … 1621 1658 pass 1622 1659 1623 self.execute("CREATE TEMPORARY TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)") 1660 # XXX EAM : 20140727: for now this is not temporary (for debugging) 1661 # self.execute("CREATE TEMPORARY TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)") 1662 self.execute("CREATE TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)") 1624 1663 for row in rows: 1625 1664 … … 1702 1741 try: 1703 1742 rs = self.executeQuery(sql) 1704 while (rs.next()): ids.append(rs.getInt(1)) 1743 while (rs.next()): 1744 ids.append(rs.getInt(1)) 1745 print "stage_id: " + str(rs.getInt(1)) 1705 1746 except: 1706 1747 self.logger.errorPair("Can't get items in this box", sql)
Note:
See TracChangeset
for help on using the changeset viewer.
