[DB-SIG] mxODBC insert error. Reply

Khawaja-Shahzad Butt kshahzadbutt at gmail.com
Thu Oct 14 21:53:17 CEST 2004


Hi,
         When i try to insert into MS SQL server using mxODBC. python gives me
this error:

Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\feedparser-3.3\feedparser\test.py", line 559, in ?
  File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract
    rss_20extraction(result,url)
  File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction
    dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified)
  File "C:\feedparser-3.3\feedparser\test.py", line 417, in dbinsertfeeditem
    
DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid
character value for cast specification', 4579)
 


Here is my insert statement:

q="""INSERT INTO rss_feed_items(
   item_date,
   item_title,
   item_author,
   item_permalink,             
   item_description)
    VALUES(
     ?, ?, ?, ?, ?)"""

c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription))

Could anyone tell me what seems to be wrong. Please reply.

Thank you,
Regards
Shahzad


More information about the DB-SIG mailing list