[Tutor] School Boy Error

Brian Gustin brian at daviesinc.com
Sun Apr 16 16:00:09 CEST 2006


I wonder if it could not be the extra  comma (,) at the end of your sql ?

thus: ......?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,)<--- see trailing 
comma, and no matching ?  could be a value count != column count 
mis-match   make sure you have the correct number of values to each 
column :)

On the other hand, it is also possible, if ODBC is strict about taking 
strings and ints, that you need to run a function to convert list items 
to integer values where an integer is required..



John CORRY wrote:
> Bri,
> 
>  
> 
> Print stat gives
> 
>  
> 
> Insert into cost_grid values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
> 
> ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
> 
> ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
> 
> ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,)
> 
> Traceback (most recent call last):
> 
>   File "C:\Python24\Lib\site-packages\databasemanager.py", line 31, in ?
> 
>     c.execute(stat, sql_list)
> 
> TypeError: parameters must be a list of tuples
> 
>  
> 
> Unfortunately sql_list gives the same error.
> 
>  
> 
> Thanks,
> 
>  
> 
> John.
> 
> !DSPAM:44421f56263591105852714!
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 
> !DSPAM:44421f56263591105852714!


More information about the Tutor mailing list