mysqldb - parameter issue

B

bruce

hi...

using python v2.6, using the mysqldb lib

the test tbl looks like:
DROP TABLE IF EXISTS `functionError_TBL`;
CREATE TABLE `functionError_TBL` (
`parentFunction` varchar(100) NOT NULL default '',
`currentFunction` varchar(100) NOT NULL default '',
`parentFunctionID` int(10) NOT NULL default 0,
`errorStatus` int(1) NOT NULL default 0,
`clientServerUUID` varchar(100) NOT NULL default '',
`processTime` timestamp NOT NULL default 0,
`CollegeID` int(10) NOT NULL default 0,
`CrawlID` varchar(200) NOT NULL default '',
`CollegeName` varchar(200) NOT NULL default '',
`CollegeAbbrv` varchar(200) NOT NULL default '',
.
.

the test script looks like
.
.
tlist= [(1, 1, 1281502771)]

ins="insert into functionError_TBL "
ins=ins+"(errorStatus, CollegeID, processTime)"
ins=ins+" values "
ins=ins+" (%s,%s, from_unixtime(%s))"
db.executemany (ins, tlist)


if the parameter is :
(%s,%s, from_unixtime(%s))"

it appears to work, data is inserted correctly...

if the parameters are changed to
(%s,from_unixtime(%s), %s)"

along with the corresponding insert portion, and the test list, an
error is generated..

this implies that something is going on with the use of the
"from_unixtime" that i don't fully understand..

thoughts/pointers/comments...

thanks


thoughts on how to resolve this would be greatly appreciated.

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top