Search Postgresql Archives

Re: Error in PostgreSQL query with psycopg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux