List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:November 27 2003 7:13am
Subject:Re: Multiple Primary key
View as plain text  
Hi,


> Good evening people.
>
> I'm trying to create a simple table via MySQl Navigator.
> The table il structured in this way
>
> dt_amt Date Not Null Primary Key
> oper INT Not Null Primary Key
> amount Decimal(3,3) Null ---
>
> but when I choose "fire" it shows me a "multiple primary key defined"
> message and doesn't make me create the table.
>
> Isn't MySql able to handle multiple primary key or it's a navigator bug?
> In the same day I can receive data from different operators.

It depends on what you want -

Do you want a compound primary key? If so, use the
PRIMARY KEY (col1, col2, coln) clause. If you want
multiple primary keys: no can do, only 1 primary key per
table can be defined.
If you want to enforce uniqueness in more than one column,
use additional UNIQUE constraints/indices.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com

Thread
Multiple Primary keygetting_out26 Nov
  • Re: Multiple Primary keyUnknown Sender26 Nov
    • Re: Multiple Primary keygetting_out26 Nov
  • Re: Multiple Primary keyPaul DuBois26 Nov
  • Re: Multiple Primary keyMartijn Tonies27 Nov