Re: [Python] how to tell if cursor is sqlite.Cursor or psycopg2.Cursor
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
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