I assume by "Multiple primary keys" you mean a composite primary key. All of
the ones I've had even casual contact with support composite primary keys,
but only one primary key per table (so several columns can make up one
composite primary key).

The ones I've worked with deeply enough to know a little more about (Which
is only two PC based, and one mainframe based) also support unique
constraints which are similar to a primary key, and can be composite as
well, but they are not actually a primary key. An additional difference
between a unique constraint and a primary key (as I've worked with them
anyway) is that you can define columns in a unique constraint to be
nullable, but only one null will be allowed in the key column(s).
In other words, it can have a null, but only one since a second would not be
unique - even though a null doesn't equal a null. Confusing maybe, but
that's how they work.

Steve H.

-----Original Message-----
From: Vuillemot, Ward W [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 22, 2001 5:51 PM
To: [EMAIL PROTECTED]
Subject: multiple primary keys


I have a question regarding multiple primary keys. Do all DBs handle multple
primary keys?  In addition, can only one of the primary keys be
autoincremented?
I am curious how this pertains to mySQL where we have:
        $sth->{'mysql_insertid'};

Is there a way to determine the name of column that was autoincremented?
Easily, that is. . . .ie, a simple command such
        $sth->{'hashValueHere'};

Thanks,
Ward

Reply via email to