OK. Got the same error when
>>>str(final_qu)but then I put the str() inside the % formatting:>>>StoreData.AddData("INSERT INTO house VALUES (%s)" % (str(final_qu)))
I get the following:
File does not exist: /usr/local/www/data/favicon.icoPremature end of script headers: House.cgi, referer: http://nova/~agh/house.htmlNOTICE: identifier "'s','ss','s','s','ss','s','s','s','s','ss','s','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','2003-08-14','01:08:34'" will be truncated to "'s','ss','s','s','ss','s','s','s','s','ss','s','N/A','N/A','N/A", referer: http://nova/~agh/house.htmlTraceback (most recent call last):, referer: http://nova/~agh/house.html File "/home/agh/cgi-bin/House.cgi", line 35, in ?, referer: http://nova/~agh/house.html StoreData.AddData("INSERT INTO house VALUES (%s)" % (str(final_qu))), referer: http://nova/~agh/house.htmlFile "/home/agh/cgi-bin/StoreData.py", line 16, in AddData, referer: http://nova/~agh/house.html cur.execute(query), referer: http://nova/~agh/house.htmlFile "/usr/local/lib/python2.3/site-packages/pgdb.py", line 189, in execute, referer: http://nova/~agh/house.html self.executemany(operation, (params,)), referer: http://nova/~agh/house.htmlFile "/usr/local/lib/python2.3/site-packages/pgdb.py", line 208, in executemany, referer: http://nova/~agh/house.html raise DatabaseError, "error '%s' in '%s'" % ( msg, sql ), referer: http://nova/~agh/house.htmlpgdb.DatabaseError: error 'ERROR: parser: parse error at or near ")" at character 224, referer: http://nova/~agh/house.html' in 'INSERT INTO house VALUES (("'s','ss','s','s','ss','s','s','s','s','ss','s','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','N/A','2003-08-14','01:08:34'", 1))', referer: http://nova/~agh/house.html
[edited by - clash rocker on August 14, 2003 1:24:28 AM]