MySQL Forums
Forum List  »  Spanish

Re: Insertar datos en una tabla
Posted by: Miguel Perez
Date: October 17, 2008 06:58AM

Si tuviera que insertar datos en una tabla (y suponiendo que los datos son muchos y no lo puedo hacer manualmente), intentaría convertirlos a SQL o a algo que pueda cargar con LOAD DATA, o simplemente lo haría desde un sencillo programa de Python:

import MySQLdb
cur = MySQLdb.connect(unix_socket='/tmp/mysql.sock', user='root', passwd='...', db='...').cursor()
cur.execute('INSERT INTO tabla VALUES (%s, %s, %s...)', (datos...))

También mira executemany.

Un saludo,

Miguel Pérez
Afina Sistemas - Partner de MySQL en España



Edited 1 time(s). Last edit at 10/17/2008 06:58AM by Miguel Perez.

Options: ReplyQuote


Subject
Views
Written By
Posted
8271
September 05, 2008 10:27AM
2147
September 05, 2008 11:07AM
19146
September 08, 2008 12:36PM
6253
September 08, 2008 05:39PM
3568
October 10, 2008 04:29AM
9375
October 13, 2008 11:15AM
Re: Insertar datos en una tabla
4016
October 17, 2008 06:58AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.