"Rughwani, Devashish (Devashish)" <[EMAIL PROTECTED]> wrote:
> 
> Is it possible to make a column of TEXT data type as PRIMARY key ?
> 
> How to give the lenght for the below error ?
> "ERROR 1170 (42000): BLOB/TEXT column 'colname' used in key specification
> without a key length"
> 

For BLOB/TEXT column you can create index only on the prefix of column. For example:

mysql> CREATE TABLE t1(
    -> mytext TEXT,
    -> PRIMARY KEY (mytext(100)));
Query OK, 0 rows affected (0.01 sec)



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to