I have a followup question:

You posted above a function for retrieving the values by using another
select query.
The fact is that regardless of the differences between SQLalchemy
0.3.6 to 0.3.9, MySQL returns the value of the non-primary-key
autoincrement column, otherwise 0.3.6 would not have that data without
querying the MySQL server again (at least there is no query according
to the debug log).
Will there be another method to get it?


On Jul 9, 9:50 am, mc <[EMAIL PROTECTED]> wrote:
> Too bad :-)
> Saves me a query.
>
> Thanks
>
> On Jul 8, 11:41 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> > right. like ive been saying all along, this bug is fixed in trunk and
> > will be out in 0.3.9.
>
> > On Jul 8, 2007, at 11:52 AM, mc wrote:
>
> > > from sqlalchemy import *
> > > db=create_engine('mysql://user1:[EMAIL PROTECTED]/tests')
>
> > > create_s = """
> > > CREATE TABLE `users` (
> > > `user_name` varchar(16)  NOT NULL ,
> > > `ID` int unsigned NOT NULL auto_increment,
> > > PRIMARY KEY  (`user_name`),
> > > UNIQUE (`ID`)
> > > ) ENGINE=InnoDB
> > > """
>
> > > db.execute("DROP TABLE IF EXISTS `users`")
> > > db.execute(create_s)
>
> > > md=BoundMetaData(db)
> > > t=Table('users', md, autoload = True)
>
> > > r = t.insert().execute(user_name='Jack')
> > > print r.last_inserted_ids()
>
> > > r = t.insert().execute(user_name='Jill')
> > > print r.last_inserted_ids()


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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