Re: [Python] how to tell if cursor is sqlite.Cursor or psycopg2.Cursor

2011-01-25 Thread dmaziuk
D'oh. You're right, of course. Thank you Dima -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python] how to tell if cursor is sqlite.Cursor or psycopg2.Cursor

2011-01-24 Thread Chris Gonnerman
You're looking at it wrong. It doesn't matter what type of cursor it is, only if you can get the correct number. So use a try...except: try: cursor.execute(""" select last_insert_rowid() """) except: cursor.execute(""" select currval('my_sequence') """) That's