On Nov 10, 2007, at 1:44 AM, david wrote:
>
>
> Here's an example - 2 tables author_t, and keyword_t
>
> author_t = Table('author', meta,
> Column('authorkey', Unicode(35), primary_key=True),
> Column('lastname', Unicode),
> Column('firstname', Unicode),
> )
> keyword_t = Table('keyword', meta,
> Column('word', Unicode(20), primary_key = True),
> Column('stem', Unicode(20)),
> Column('freq', Integer),
> )
>
> 1. when I do the following, *never* have seen the error ("keyword" set
> to a unicode string):
>
> s1 = select([keyword_t.c.word,],
> keyword_t.c.word == keyword)
>
> keyword = Session.execute(s1).fetchone()
>
> 2. However, when I do the following, I *always* find errors in a run
> ("authorkey" set to a u string):
>
> s1 = select([author_t.c.authorkey,],
> author_t.c.authorkey == authorkey)
>
> author = Session.execute(s1).fetchone()
>
> So I am totally confused. What I am doing should be very simple. The
> tables are simple. The relations are simple.
>
> Can you shed any light?????
>
> Thanks a million for your help.
>
david, heres what might help, close out the result sets:
result = Session.execute(s1)
author = result.fetchone()
result.close()
the difference between the two queries might be that the keyword query
only has one row (the result set closes automatically when all results
are consumed).
also the error youre getting is a garbage collection warning so its
not the end of the world, its probably just those cursors with pending
results not closing nicely.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---