List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 22 2003 4:36am
Subject:Re: Importing into an AutoIncrement field
View as plain text  
At 22:28 -0600 3/21/03, Paul DuBois wrote:
>At 20:04 -0800 3/21/03, Todd Cary wrote:
>><div class="moz-text-flowed" style="font-family: -moz-fixed">I 
>>would like to avoid the necessity of specifying all of the fields -
>>instead use the following syntax:
>>
>>INSERT INTO teachers VALUES
>>(1,12345,NULL,'Harry','Smith','707-773-4523',2',...
>>
>>However, the first field is an autoincrementing field.  Will MySQL
>>ignore my value and overwrite it with the "auto" value?
>
>No.  It will only generate an auto-increment value if you specify NULL or
>omit the column value from the statement.  In the latter case you
>must provide a column list so that MySQL knows which data values go in
>which clients.

Er, ... go in which *columns*.

>
>
>--
>Paul DuBois
>http://www.kitebird.com/
>sql, query

Thread
Importing into an AutoIncrement fieldTodd Cary22 Mar
  • Re: Importing into an AutoIncrement fieldPaul DuBois22 Mar
    • Re: Importing into an AutoIncrement fieldPaul DuBois22 Mar