-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Karl Lautman wrote: > Can someone point out to me the syntax error in the following? I've omitted > the set-up code for brevity, but cur is a cursor with a connection to the > database. Thanks. > >>>> x = cur.execute('last_insert_rowid()')
last_insert_rowid() is a function just like min, max, hex, length etc. See http://www.sqlite.org/lang_corefunc.html So to get the value you need to use: cur.execute("select last_insert_rowid()") It looks like you are using pysqlite so you can just do this which does the same thing behind the scenes: x=cur.lastrowid Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkkFREsACgkQmOOfHg372QQGcQCg5mJ6n7KY7lIF33nXuj10zQDX 698AnRfN3ZplfMYf4SvT3vzfsg40kUJV =q4tC -----END PGP SIGNATURE----- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users