Changeset 31380 for trunk/ippToPsps/jython/mysql.py
- Timestamp:
- Apr 25, 2011, 3:21:40 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/mysql.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/mysql.py
r31366 r31380 106 106 107 107 ''' 108 Reports the number of rows with this columns set as this numeric value and then deletes them 109 ''' 110 def reportAndDeleteRowsWithThisValue(self, tableName, columnName, value): 111 112 sql = "SELECT COUNT(*) FROM " + tableName + " WHERE " + columnName + " = " + value 113 rs = self.stmt.executeQuery(sql) 114 rs.first() 115 nBadFlux = rs.getInt(1) 116 self.logger.info("%d NULL %s values in table %s. Deleting." % (nBadFlux, columnName, tableName)) 117 118 sql="DELETE from " + tableName + " WHERE " + columnName + " = " + value 119 self.stmt.execute(sql) 120 121 ''' 108 122 Reports the number of rows with this column NULL and then deletes them 109 123 '''
Note:
See TracChangeset
for help on using the changeset viewer.
