dischdennis wrote: > what is the easiest way to find out the last insert id? (MySQL 5) > > supplast = > select([func.last_insert_id()],app_schema.SupplierTable.c.pr_supplier_ID > > 0).execute().fetchone()[0] > > does not work for some reason > > > Dennis
result = table.insert().execute(**kwargs) id = result.last_inserted_ids()[0] # or, more mysql specific, but works with straight text SQL as well id = result.cursor.lastrowid --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---