Re: Python: Text file insert to MySQL

2009-10-07 Thread Gerhard Häring
On Wed, Oct 7, 2009 at 1:32 PM, Schedule wrote: > That was great ! Now I am able to insert the values from the file. > > Somehow I am not able to update a specific field with all the vaues in the > file. For eg: >     [...] >     c.execute("UPDATE a SET last = %s", row) The database does what you

Re: Python: Text file insert to MySQL

2009-10-07 Thread Schedule
That was great ! Now I am able to insert the values from the file. Somehow I am not able to update a specific field with all the vaues in the file. For eg: Before the update my table contents are: +---+---+ | first | last | +---+---+ | Sara | Jones | | Terry | Burns | | Filiz |

Re: Python: Text file insert to MySQL

2009-10-06 Thread Gerhard Häring
Schedule wrote: > Hello, > > I am currenty using MySQL 5.1 community server and trying to import the > data of the comma delimited text file into the table using python 2.6 > scripts. I have installed Mysqldb 1.2.2. > > follwoing is my script: > [...] >7. > c.execute("INSERT INTO a (fir

Python: Text file insert to MySQL

2009-10-06 Thread Schedule
Hello, I am currenty using MySQL 5.1 community server and trying to import the data of the comma delimited text file into the table using python 2.6 scripts. I have installed Mysqldb 1.2.2. follwoing is my script: 1. import MySQLdb, csv, sys 2. conn = MySQLdb.connect (host = "localhost"