Re: Error in PostgreSQL query with psycopg - Mailing list pgsql-general

From Parthan SR
Subject Re: Error in PostgreSQL query with psycopg
Date
Msg-id 9d6d3deb0607312122j1e35f5b3y87f23a17afc5b749@mail.gmail.com
Whole thread Raw
In response to Error in PostgreSQL query with psycopg  (Parthan <parth.technofreak@gmail.com>)
List pgsql-general
Hii,

With regards to the previous mail and replaies, I tried with this code. Although it doesn't give any error when i run it as a script,  but the return value is NONE for 'q', which is assigned to return value of cursor.execute(), and the data are not inserted into the database.

[code]

name = 'GLV'
host = 'Parthan'
start = '04-08-2006'
end = '04-08-2006'
days = 1
starttime = '15:00:00'
endtime = '18:00:00'
size = 20

arglist =  (name, host, start, end, days, starttime, endtime, size)

connection = connect("dbname=TimeTable user=myname password=mypassword")
cur = connection.cursor()
q = cur.execute("INSERT INTO ConfMain (ConfName, ConfHost, ConfStart, ConfEnd, ConfDays, ConfStartTime, ConfEndTime, ConfSize) VALUES (%s, %s, %s, %s, %i, %s, %s, %i);", arglist)
print q

<Result: q=> None

Am not getting any other error, I tried this one by calling the script in the temrinal. When i ran a similar one with the browser, it says premature end of script :(

http://pastebin.de/9994 --> this is my apache error log (/var/log/apache2/error.log)

--
With Regards


---
Parthan.S.R.
Research Assistant
National Resource Center for Free/Open Source Software
Python Developer n00b

pgsql-general by date:

Previous
From: Christian Kastner
Date:
Subject: Re: pg_xlog not cleaned up
Next
From: Volkan YAZICI
Date:
Subject: Re: Error in PostgreSQL query with psycopg