[DB-SIG] PyGresSql help
Jim Johannsen
jjsa@gvtc.com
Mon, 24 Jan 2000 22:38:47 -0600
I am trying to use PyGresSQL to connect Python and Postgress. I have
managed to connect to the db, but cannot update the database with a list
or with strings. I have tried the following code w/o success:
cnx.query("INSERT INTO county VALUES(%s,%s,%s)") %(Ldata[0], Ldata[1],
Ldata[3])
cnx.query("INSERT INTO county VALUES('%s,%s,%s')") %(Ldata[0],
Ldata[1], Ldata[3])
cnx.query("INSERT INTO county VALUES(%s,%s,%s)") %(x,y,z) where x,y
and z are strings.
and countless variations of the above. Every variation but the correct
one.
I have also tried to insert lists through the inserttable function.
Can't get it to update either.
I can insert hard coded values into the database so I know I can
insert, just not by reference.
Could some one point out the error of my ways.