INSERT INTO table (name) VALUES ("Roland684"); SELECT id FROM table WHERE name = "Roland684"; #### INSERT INTO table (name) VALUES ("Roland684") RETURNING id; #### my $sth = $dbh->prepare($query); my $insertedrecords = $sth->execute; while (my $result = $sth->fetchrow_hashref) { ... }