Multiple database support

Bradley Baetz bbaetz at acm.org
Tue Sep 2 10:01:45 UTC 2003


On Mon, Sep 01, 2003 at 06:13:12PM -0400, David Miller wrote:
> > I haven't tested it yet, but PostgreSQL requires correct ANSI SQL '
> > placement.  Furthermore, one thing I cannot easily provide is the
> > LAST_INSERT_ID()/@@identity stuff.  PostgreSQL requires use of its
> > sequences for that and I'd reckon Oracle does as well (need to check).

The latest DBI has an API for this. I don't know what DBD drivers
support it, but I'd prefer to use the official interface for this now
that one exists.

> We ended up not using @@identity on the Sybase port - Sybase's
> implementation of it sucks, and it's not reliable, so we created a new
> table to hold key numbers and do the lock/increment/select/unlock on the
> appropriate row in that table to get key numbers (which means retrieving a
> new key prior to doing an insert, and including the key in the insert
> statement).

I haven't checked the implementation, so I don't know what hte final 
result was, but When it first came up on dbi-devel, there was a
fair bit of talk over the sybase issues with this.

Bradley



More information about the developers mailing list