guarda se รจ il tuo caso http://mysql-python.sourceforge.net/FAQ.html#other-errors
Starting with 1.2.0, MySQLdb disables autocommit by default, as required by the DB-API standard (PEP-249). If you are using InnoDB tables or some other type of transactional table type, you'll need to do connection.commit() before closing the connection, or else none of your changes will be written to the database. Grazia On Mon, Oct 6, 2008 at 9:25 PM, Francesco Martino < [EMAIL PROTECTED]> wrote: > Chiedo scusa ma ho riportato il codice in modo errato. > Di seguito si trova quello corretto: > > > > **************************************************************************************************************** > import MySQLdb > > db = MySQLdb.connect(host = 'localhost', db = 'nome_db', user = 'user', > passwd = 'password') > cur = db.cursor() > > def createTable(curs): > curs.execute('SELECT tab1.valA, tab1.valB, tab2.valC, tab2.valD\ > FROM tab1 JOIN tab2 \ > ON tab1.valE = tab2.valE\ > WHERE tab1.valA>0') > for data in cur.fetchall(): > dataList.append(data) > curs.execute('CREATE TABLE tab3 (\ > valA char(50),\ > valB char(50),\ > valC char(50),\ > valD char(50))') > print 'tabella costruita...' > curs.executemany("INSERT INTO tab3 (valA, valB, valC, valD) \ > VALUES (%s,%s,%s,%s)", dataList) > print 'valori inseriti' > > if __name__= '__main__': > createTable(cur) > > **************************************************************************************************************** > > Francesco > _______________________________________________ > Python mailing list > Python@lists.python.it > http://lists.python.it/mailman/listinfo/python >
_______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python