List:General Discussion« Previous MessageNext Message »
From:Ronan Date:February 16 2006 11:56am
Subject:primary key
View as plain text  
Im trying to set up a primary key of server(text), date (date), hour 
(small int) but when i try to include the server field in the key it 
replies with

ALTER TABLE `exim` DROP PRIMARY KEY ,
ADD PRIMARY KEY ( `date` , `hour` , `server` )

#1170 - BLOB/TEXT column 'server' used in key specification without a 
key length

i have googled, but not much is relevant to my example i dont think..


CREATE TABLE `exim` (
   `date` date NOT NULL default '0000-00-00',
   `server` longtext NOT NULL,
   `hour` tinyint(4) NOT NULL default '0',
   `count` smallint(6) NOT NULL default '0',
   PRIMARY KEY  (`date`,`hour`),
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='exim realtime stats';

thanks
Ronan
-- 
Ronan McGlue
Analyst / Programmer
CMC Systems Group

Queens University Belfast
Thread
primary keyRonan16 Feb
  • Re: primary keyAlec.Cawley16 Feb
  • Re: primary keyMartijn Tonies16 Feb