You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I needed help on IRC, and I consider myself a seasoned DBI user.
I'd add this:
diff --git a/Pg.pm b/Pg.pm
index 408d227..cc2e3f4 100644
--- a/Pg.pm
+++ b/Pg.pm
@@ -2664,6 +2664,19 @@ If you did not want to worry about the sequence name:
print "Last insert id was $newid\n";
}
+or, using C<RETURNING>:
+
+ $dbh->do('CREATE TABLE lii2 (
+ foobar SERIAL UNIQUE,
+ baz VARCHAR)');
+ $SQL = 'INSERT INTO lii2(baz) VALUES (?) RETURNING foobar';
+ $sth = $dbh->prepare($SQL);
+ for (qw(uno dos tres cuatro)) {
+ $sth->execute($_);
+ my ($newid) = $sth->fetchrow_array;
+ print "Last insert id was $newid\n";
+ }
+
=head3 B<commit>
$rv = $dbh->commit;
Does that make sense? Want a PR
The text was updated successfully, but these errors were encountered:
I needed help on IRC, and I consider myself a seasoned DBI user.
I'd add this:
Does that make sense? Want a PR
The text was updated successfully, but these errors were encountered: