I am calling commit, right after updated those two values.
Any suggestion on what else to check?

On Wednesday, April 8, 2015 at 7:33:49 PM UTC-6, Michael Bayer wrote:
>
>  
>
> On 4/8/15 9:16 PM, arash afshar wrote:
>  
> When I try to update a row using ORM in the following way, it shows the 
> following error: 
> InterfaceError: (InterfaceError) Error binding parameter 0 - probably 
> unsupported type. u'UPDATE table_name SET unicode_col=?, int_col=? WHERE 
> table_name.id = ?' ((u'abcd',), 1, 2)
>  
>  
>  I suspect the problem is that the value corresponding to unicode_col is 
> (u'abcd',) as opposed to a simple u'abcd'.
>  
> that is the problem.
>
>   
>  Here is how I update the database:
> 1) I first query it and obtain an object representing the row that I need 
>   -->  file_row
> 2) I perform some checks and change the values  --> file_row.int_col = 1   
>  followed by   file_row.unicode_col = u"abcd"
> 3) I call commit on the session
>
>   
> looks fine, so, I'd imagine that somehow that unicode_col = u'abcd' is not 
> what it seems.  Either that's not what's there or something is interfering 
> with it after the fact.
>
>
>
>
>   I am pretty sure the problem is not the original type of value of the 
> unicode_col since the following succeeds without error:
>  
>  query(TableName).filter(TableName.id == file_row.id).update({'unicode_col': 
> u"abcd", 'int_col': 1})
>  
>  
>  Any idea how to fix the error?
> Thanks
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>
>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to