Changeset 33780
- Timestamp:
- Apr 13, 2012, 2:10:56 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/mysql.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/mysql.py
r33683 r33780 90 90 91 91 ''' 92 Checks whether this table exists 93 ''' 94 def tableExists(self, tableName): 95 96 sql = "SELECT COUNT(*) \ 97 FROM information_schema.tables \ 98 WHERE table_schema = '" + self.dbName + "' \ 99 AND table_name = '" + tableName + "'" 100 101 try: 102 rs = self.executeQuery(sql) 103 rs.first() 104 if rs.getInt(1) > 0: return True 105 else: return False 106 except: 107 self.logger.errorPair("Could not check if table exists", sql) 108 pass 109 110 return False 111 112 ''' 92 113 Checks whether there are any other connections to this database 93 114 ''' … … 157 178 try: self.execute(sql) 158 179 except: return 180 181 ''' 182 Drops a list of tables 183 ''' 184 def dropTables(self, tables): 185 for table in tables: self.dropTable(table) 159 186 160 187 '''
Note:
See TracChangeset
for help on using the changeset viewer.
