Newbie problem inserting into MySQL

Fredrik Lundh fredrik at pythonware.com
Mon Aug 18 15:38:35 EDT 2008


Edwin.Madari at VerizonWireless.com wrote:

> another thing - cumulative inserts will result, since
 > listofrec is not emptied after each sql execution.

isn't that the point? -- he's building an argument array, and passing it 
to executemany after it's reached a given size.

(to the OP, a quick code review doesn't reveal anything obvious -- but 
you might want to test this with a much smaller dataset to make it 
easier to debug.  what happens if you call execute once for each row? 
what happens if you call executemany after, say, 10 rows?  what does 
listofrec look like in that case if you print it?)

</F>




More information about the Python-list mailing list