you need to execute() your insert statement.   the return value of that is
where you can fetchall().


Gloria W wrote:
>
> Hi all,
> I am trying to use the postgres_returning feature with the latest svn
> checkout of SqlAlchemy, Python 2.5.2, and Postgresql 8.3.
>
> I have a declarative_base, which works in the declarative base
> context. I get it's table reference this way:
>
>                        al_table = ActivityLog.__table__
>
> My postgres_returning usage looks like this:
>
>                         result = al_table.insert(
>                                 postgres_returning=[
>                                 al_table.c.userID,
> al_table.c.logtypeID,
>                                 al_table.c.logcategoryID,
> al_table.c.notes,
>                                 al_table.c.direction]
>                                 ).values(userID=1003,logtypeID=10,
> logcategoryID=103,
>                                 notes="Member registered, push to TPA
> is happening.",
>                                 direction= "INTERNAL")
>
>                         new_record = result.fetchall()
>
>
> This is my error:
>
> -> new_record = result.fetchall()
> (Pdb) c
> Traceback (most recent call last):
>   File "outgoing_process.py", line 181, in <module>
>     x.prepOutgoing()
>   File "outgoing_process.py", line 96, in prepOutgoing
>     new_record = result.fetchall()
> AttributeError: 'Insert' object has no attribute 'fetchall'
>
>
>
> Did I mess this up in some way, or hit a bug? Can I use a
> declarative_base table ref this way?
>
> Thank you in advance,
> Gloria
>
> PS: I still owe you a working sample of a previous problem I reported
> involving session scope. I have not forgotten, but I've been too
> swamped to do it. I'll have time next week to prepare this and send it
> out.
>
> >
>


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to