Right, only on an INTEGER col, as documented [sheepish grin]

thanks all

matt

On Mon, 07 May 2001, Peter Pentchev wrote:

> 
> On Mon, May 07, 2001 at 07:21:59AM -0700, [EMAIL PROTECTED] wrote:
> > 
> > Hi all,
> > 
> > I've started using MySQL for the first time and I'm hvaing a bit of a problem with 
>defining an AUTO_INCREMENT column.  I'm using ver 3.23.32 which I downloaded for 
>Linux and Win2k.  I am having this problem on both systems.
> > 
> > Ok if I try to run the create table statement:
> > 
> > create table test
> > (id_pk numeric(10) AUTO_INCREMENT)
> > 
> > I get the error:
> > 
> > Error while executing statement:
> > Invalid argument value: Incorrect column specifier for column 'id_pk'
> > Correct the statement and do another try!
> > 
> > 
> > Does anyone know why this happens?  Am I missing something that needs to included 
>during compilation?
> 
> Nope, it's just that AUTO_INCREMENT can only be used with INTEGER columns.
> Also, an AUTO_INCREMENT column must be defined as a key.  So, try:
> 
> CREATE TABLE test (id_pk INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY);
> 
> G'luck,
> Peter
> 
> -- 
> I am not the subject of this sentence.
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


______________________________________________________
123India.com - India's Premier Portal 
Get your Free Email Account at http://www.123india.com



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to