Tema: postgres
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/06/2006, 10:40
apolo64
 
Fecha de Ingreso: abril-2006
Mensajes: 12
Antigüedad: 18 años
Puntos: 0
postgres

Hola amigo.
Tengo problemas para poblar la base de datos me envi un error que no cache de que se trata, si me pudiesen ayudar por favor. A continuacio les envio el codigo. y al fina va el error.

>>> from pyPgSQL import PgSQL
>>> db = PgSQL.connect(database='certamen2', host='localhost', user='postgres', password='1234')
>>> db = PgSQL.connect(database='certamen2', host='localhost', user='postgres', password='1234')
>>> cursor = db.cursor()
>>> for i in range (1,3393):
... r=randrange(0,999)
... nom=str(r)
... stock=float(r)
... tipo_ar=int(r)
... r1=randrange(0,999)
... tipo_un=int(r1)
... activo='true'
... r2=randrange(0,999)
... alias=str(r2)
... cursor.execute("insert into articulo
... values(%d,%s,%f,%d,%d,%s,%s)%(i,'nom',stock,tipo_a r,tipo_un,activo,'alias')")
Traceback ( File "<interactive input>", line 11
cursor.execute("insert into articulo
^
SyntaxError: EOL while scanning single-quoted string