[Tutor] Problem with mxODBC insert statement

nik my.mailing.lists at noos.fr
Tue Oct 12 23:26:11 CEST 2004


This is only a guess, but if (item_dmodified) is a tuple, shouldn't it 
be (item_dmodified,) for a tuple with a single item (ie missing the comma).

nik

Khawaja-Shahzad Butt wrote:

>Hello,
>
> I don't know how to use SQL which way for mxODBC and
>python. I used this statement and got this error.
>
>q= "INSERT INTO
>rss_feed_items(item_date,item_title,item_author,item_permalink,item_description)\
>   VALUES(%s)"%(item_dmodified);
>
>MS SQL server 2000 gave me this error for above query statement:
>
>ProgrammingError: ('37000', 170, "[Microsoft][ODBC SQL Server
>Driver][SQL Server]Line 1: Incorrect syntax near '06'.", 4612)
>
>or  can i use the ? instead of %s can you give me example since there is
>none in egenix manual for mxODBC. What am i doing wrong.
>Also should always use auto_commit while using mxODBC
>
>Please reply.
>Thank you,
>Regards
>Shahzad
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>
>  
>



More information about the Tutor mailing list