I expect he was looking for an abstraction around the concept of
auto-increment primary key / sequence, etc.

Dan,

As Greg mentioned, since 1.38, DBI has specified a C<last_insert_id>
method.  The docs recommend caution when using this method, however,
since its operation may or may not be defined depending on which DBD
driver used.

http://search.cpan.org/~timb/DBI-1.605/DBI.pm#last_insert_id

Which driver(s) do you intend to use?

Cheers,

C.J.

On Mon, 2008-06-30 at 13:42 +0000, Greg Sabino Mullane wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
> 
> 
> > I'm looking for a *portable* way to detect auto-incrementing primary
> > keys. Is there one?
> 
> No - because there is no universal concept of an "auto-incrementing"
> primary key. MySQL and SQLite have a specific column modifier
> called AUTOINCREMENT. Postgres uses sequences and a default value.
> Oracle uses sequences and a trigger. And so on. Perhaps if you explain
> what exactly you are trying to do, another solution (such as
> $dbh->last_insert_id() perhaps?) may present itself.
> 
> - --
> Greg Sabino Mullane [EMAIL PROTECTED]
> PGP Key: 0x14964AC8 200806300940
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
> -----BEGIN PGP SIGNATURE-----
> 
> iEYEAREDAAYFAkho4m0ACgkQvJuQZxSWSsiwWACg/mL+78Lhn38oJnYw3TLNeK1H
> jPIAn0U44fdfLuNNNXoUjnP7757Ie+7S
> =DhL1
> -----END PGP SIGNATURE-----
> 
> 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to