MySQLdb insert fails on one table

S

Sells, Fred

I have this table

mysql> describe valid_individuals;
+-------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| fname | varchar(30) | YES | | NULL | |
| lname | varchar(30) | YES | | NULL | |
| alias | varchar(30) | YES | | NULL | |
| email | varchar(100) | YES | | NULL | |
+-------+--------------+------+-----+---------+-------+


I call this function

def insertRecords(self, tablename, columnnames, values, clear=True):
cursor = self.Connection.cursor()
sql = "INSERT INTO %s (%s) VALUES (%s)" % (tablename,
','.join(columnnames), ','.join(['%s' for x in columnnames]))
print >>sys.stderr, sql, values[:3]
cursor.executemany(sql, values)
cursor.close()
which prints:
INSERT INTO valid_individuals (fname,lname,alias,email) VALUES (%s,%s,%s,%s)
[['xxxx', 'yyyy', 'zzzzz', 'aaaaaa']]

this function works fine for several other tables, but on this one I get no
errors and there is nothing in the table. If I run the equivalent insert on
the command line, it's just fine.

I'm lost here; Python 2.4.4 and latest MySQLdb for 2.4.4; anyone got a
clue?

---------------------------------------------------------------------------
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top