Re: Interesting issue with create()
[prev]
[thread]
[next]
[Date index for 2004/11/02]
On Sun, 31 Oct 2004 13:21:17 -0500, Lance A. Brown <lance@xxxxxxxxxx.xxx>
wrote:
> Isn't automatic setting of primary key fields only available when you
> have a sequence associated with the table in question?
>
> --[Lance]
>
Available for what? CDBI, or DB2? Or Postgres?
The answers are "Don't know", "no", and "possibly" in order. Since I'm
fairly sure CDBI supports MySQLs auto-increment somehow, I'd guess that
its not the only way to do it with CDBI. I guess MySQL is happy when you
throw a value at an auto-increment field, and it 'just works'. DB2 is not.
It appears CDBI supports sequences by calling 'SELECT NEXTVAL
<sequence-name>' (unless I read the code wrong), which will also not work
on DB2, as it likes to have 'SELECT NEXTVAL FOR <sequence-name>' .. Oh the
joys of 'standard' SQL..
Anyway, there are many ways to do it, and unless the various
Class::DBI::<DB> modules override this to do whatever the DB-variant
wants, then what CDBI supports is just one kinda broken way to do it. It
probably shouldnt have it built-in at all, but farm out to those modules.
(So people reading the docs don't think it actually means it will work for
all auto-increment/sequence implementations)
Jess
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
|
(message missing)
|
|
|
Re: Interesting issue with create()
Jess Robinson 06:28 on 02 Nov 2004
|