Re: Error in PostgreSQL query with psycopg

From: "Parthan SR" <python(dot)technofreak(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Error in PostgreSQL query with psycopg
Date: 2006-08-01 04:22:24
Message-ID: 9d6d3deb0607312122j1e35f5b3y87f23a17afc5b749@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Christian Kastner 2006-08-01 05:53:01 Re: pg_xlog not cleaned up
Previous Message John D. Burger 2006-08-01 01:47:40 Re: Error in PostgreSQL query with psycopg