[Tutor] error binding parameter 1

bob gailer bgailer at alum.rpi.edu
Sun Nov 25 02:55:23 CET 2007


Dinesh B Vadhia wrote:
> Hello!  Can anyone see what the problem with this code snippet is?
>  
> Dinesh
>  
> ------------------------------------------------------------------------
>             image_filename = str(dir_list[i])
>             image_file = dir_path + image_filename
>             image_blob = open(image_file, 'rb')
Should that be
image_blob = open(image_file, 'rb').read()?
> [L40]   cursor.execute("Insert into image_table values (?, ?)", 
> (image_filename, image_blob))
>  
> Traceback (most recent call last):
>   File "C:\storage management.py", line 40, in <module>
>     cursor.execute("Insert into image_table values (?, ?)", 
> (image_filename, image_blob))
> InterfaceError: Error binding parameter 1 - probably unsupported type.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>   



More information about the Tutor mailing list