On Oct 27, 2010, at 5:06 PM, justin wrote:
> I have a table in my db, named nameConversions.
> The scheme is as follows:
> nameConversions = Table('nameConversions', metadata,
> Column('ConversionID', Integer, primary_key=True),
> Column('TaxonCode', String(lenAbbr), nullable=False),
> Column('Note', String(1), nullable=False),
> Column('TaxonNode', Integer, nullable=False),
> Column('OfficialName', String(lenLongName), nullable=True),
> Column('CommonName', String(lenLongName), nullable=True),
> Column('Synonym', String(lenLongName), nullable=True),
> )
>
> Now, I am retrieving rows with TaxonCode 'SYTHE1' multiple times using
> SELECT, and it succeeds several times. But at the 5th execution with
> the keyword, it fails with InterfaceError. Below is the error
> message.
>
> sqlalchemy.exc.InterfaceError: (InterfaceError) Error binding
> parameter 0 - probably unsupported type. u'SELECT
> "nameConversions"."ConversionID", "nameConversions"."TaxonCode",
> "nameConversions"."Note", "nameConversions"."TaxonNode",
> "nameConversions"."OfficialName", "nameConversions"."CommonName",
> "nameConversions"."Synonym" \nFROM "nameConversions" \nWHERE
> "nameConversions"."TaxonCode" = ?' ('SYTHE1',)
>
> What I cannot understand is that now that the SELECT process has been
> run successfully several times before, why all of a sudden it crashes
> with this error message?
the InterfaceError is generated by the DBAPI. SQLAlchemy wraps this in its own
exception but that's a DBAPI message. It's hard to tell above, but it looks
like perhaps ('SYTHE1',) is a tuple when it should be a string.
>
> What I have checked was whether the types of the keyword are all the
> same as 'str', and they are. I can't think of anything I should
> investigate other than this. I already have spent too much time on
> this. So please help me.
so if you think they're all string, try to trip it up to reveal the issue. Try
"for name in names[0:4]" (something special about the # 5?) , "for name in
reversed(names)" (something special about one of them, their ordering ?), use
pdb.set_trace(), etc.
>
> FYI. the python code that's run is the following.
> -----------------------------------------------
> for name in names:
> SQLNameConversions =
> NameConversions.select(NameConversions.c.TaxonCode==str(name))
> exeNameConversions = SQLNameConversions.execute()
> -----------------------------------------------
>
>
> Thank you guys for your time to read this and to try to help me out.
> Justin.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sqlalchemy?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.