ah, sorry, I just committed to SVN a more descriptive error message  
for what that is.  the extra functions like last_inserted_ids etc.  
drive off of an ExecutionContext object which is not created when  
executing literal SQL strings.  youd have to use a metadata-generated  
SQL clause to get the extra functionality.

the new error message when you try to call off a nonexistent  
execution context is:

This ResultProxy does not have an execution context with which to  
complete this operation.  Execution contexts are not generated for  
literal SQL execution.



On Sep 23, 2006, at 4:50 PM, Samuel Abels wrote:

> Hi,
>
> the following code:
>
> dbn    = "mysql://..."
> db     = create_engine(dbn)
> sql    = "INSERT INTO ..."
> result = db.execute(sql)
> assert result is not None
> id = result.last_inserted_ids()
>
> produces this error:
>
> Traceback (most recent call last):
>   File "DB.py", line 12, in __add_object_section
>     section.set_id(result.last_inserted_ids())
>   File "sqlalchemy/engine/base.py", line 608, in last_inserted_ids
>     return self.executioncontext.last_inserted_ids()
> AttributeError: 'NoneType' object has no attribute 'last_inserted_ids'
>
> Can anyone explain what I am doing wrong?
>
> Thanks,
> -Samuel
>
> ---------------------------------------------------------------------- 
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys -- and earn  
> cash
> http://www.techsay.com/default.php? 
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to