Mercurial > repos > yufei-luo > s_mart
diff SMART/Java/Python/mySql/MySqlTable.py @ 46:169d364ddd91
Uploaded
author | m-zytnicki |
---|---|
date | Mon, 30 Sep 2013 03:19:26 -0400 |
parents | 44d5973c188c |
children |
line wrap: on
line diff
--- a/SMART/Java/Python/mySql/MySqlTable.py Wed Sep 18 08:51:22 2013 -0400 +++ b/SMART/Java/Python/mySql/MySqlTable.py Mon Sep 30 03:19:26 2013 -0400 @@ -116,18 +116,6 @@ self.mySqlConnection.executeManyQueries(commands) - def insertManyFormatted(self, lines): - """ - Insert many lines - @param lines: the list of values - @type lines: list of lists - """ - replacer = ["?"] * len(self.variables) - command = "INSERT INTO '%s' (%s) VALUES (%s)" % (self.name, ", ".join(self.variables), ", ".join(replacer)) - values = [[line[variable] for variable in self.variables] for line in lines] - self.mySqlConnection.executeManyFormattedQueries(command, values) - - def rename(self, name): """ Rename the table @@ -229,10 +217,6 @@ @type values: dict @return: the id of the added row """ - sqlValues = [values[variable] for variable in self.variables] - command = "INSERT INTO '%s' (%%s) VALUES (%s)" % (self.name, ", ".join(self.variables)) - id = self.mySqlConnection.executeFormattedQueryQuery(command, sqlValues, True) - return id sqlValues = [] for variable in self.variables: sqlValues.append(self.formatSql(values[variable], self.types[variable], self.sizes[variable])) @@ -347,3 +331,4 @@ query = self.mySqlConnection.executeQuery("SELECT * FROM '%s'" % (self.name)) print query.getLines() +