Search Postgresql Archives

Re: Error in PostgreSQL query with psycopg

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

 



On Jul 31 10:40, Parthan SR wrote:
> On 7/31/06, Richard Huxton <dev@xxxxxxxxxxxx> wrote:
> Traceback (most recent call last): File
> "/usr/lib/cgi-bin/ConfSachem/page2.py", line 75, in ? main(num_days) File
> "/usr/lib/cgi-bin/ConfSachem/page2.py", line 68, in main query =
> cursor.execute('INSERT INTO ConfMain (ConfName, ConfHost, ConfStart,
> ConfEnd, ConfDays, ConfStartTime, ConfEndTime, ConfSize) VALUES (?, ?, ?, ?,
> ?, ?, ?, ?)', (conf_name, host_name, start_day, end_day, num_days,
> start_time, end_time, aud_size)) psycopg.ProgrammingError: ERROR: syntax
> error at or near "," at character 120 INSERT INTO ConfMain (ConfName,
> ConfHost, ConfStart, ConfEnd, ConfDays, ConfStartTime, ConfEndTime,
> ConfSize) VALUES (?, ?, ?, ?, ?, ?, ?, ?)

Did you follow the 120 character? It points to ',' just after '?'. Can
you please replace '?' character with '%s'. I'm not sure but, IIRC,
psycopg variable using method (e.g. "$1, $2, ..." or "?, ?, ...")
should be adjustable.


Regards.


[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