Re: Interesting issue with create()

[prev] [thread] [next] [Date index for 2004/11/02]

From: Jess Robinson
Subject: Re: Interesting issue with create()
Date: 06:28 on 02 Nov 2004
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)

Interesting issue with create()
Drew Taylor 17:50 on 24 Oct 2004

Re: Interesting issue with create()
Perrin Harkins 19:24 on 24 Oct 2004

Re: Interesting issue with create()
Jess Robinson 10:24 on 30 Oct 2004

Re: Interesting issue with create()
Drew Taylor 17:14 on 30 Oct 2004

Re: Interesting issue with create()
Jess Robinson 06:37 on 31 Oct 2004

Re: Interesting issue with create()
Drew Taylor 18:07 on 31 Oct 2004

Re: Interesting issue with create()
Lance A. Brown 18:21 on 31 Oct 2004

Re: Interesting issue with create()
Jess Robinson 06:31 on 02 Nov 2004

Re: Interesting issue with create()
Jess Robinson 06:28 on 02 Nov 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52