List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:November 5 2001 10:39pm
Subject:RE: AUTO-INCREMENT INSERT
View as plain text  
At 4:32 PM -0600 11/5/01, Rick Emery wrote:
>Use:
>INSERT INTO table VALUES (NULL, 'abc');

Or don't specify it at all:

INSERT INTO table (val) VALUES('abc');

>
>
>-----Original Message-----
>From: Stuart Scamman [mailto:stuart@stripped]
>Sent: Monday, November 05, 2001 4:21 PM
>To: mysql@stripped
>Subject: AUTO-INCREMENT INSERT
>
>
>Is there a way to specify using the default value for auto-increment
>field during insert statement without having to specify the col_name
>list.
>
>For example, In ASE, DEFAULT would be used.
>
>
>CREATE TABLE test (
>   id             int AUTO_INCREMENT NOT NULL,
>   val               varchar(255)  DEFAULT ''   ,
>   PRIMARY KEY (id)
>);
>
>    
>
>INSERT INTO table VALUES (DEFAULT, 'abc');
>
>
>
>
>
>---------------------------------------------------------------------
>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 <mysql-thread90127@stripped>
>To unsubscribe, e-mail <mysql-unsubscribe-paul=snake.net@stripped>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Thread
AUTO-INCREMENT INSERTStuart Scamman5 Nov
RE: AUTO-INCREMENT INSERTRick Emery5 Nov
RE: AUTO-INCREMENT INSERTPaul DuBois5 Nov