...and using the DBI func method will pull out the value for you after an insert:
$dbh->do( q{ CREATE TABLE foo ( id integer not null primary key, name varchar(20) ) }); $dbh->do( "INSERT INTO foo ( name ) VALUES ( 'bar' )" ); print "ID of record: ", $dbh->func( 'last_insert_rowid' ), "\n";
Chris
M-x auto-bs-mode
In reply to getting the SQLite incremented ID
by lachoy
in thread Can SQL be used without a database?
by thegoaltender
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |