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.

If you specify an explicit value for the auto-increment column (as you
do above), and the value already exists in the table, you'll get a
duplicate key error, assuming that you've declared it as a PRIMARY KEY
or UNIQUE index.


The next is question is the command line syntax for importing a file liek the above? I have never done it and I am using the Linux version of MySQL.

I don't understand the question. It appears to defy parsing. :-)



Todd


--
Ariste Software, Petaluma, CA 94952 \n [EMAIL PROTECTED]

</div>


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

---------------------------------------------------------------------
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