List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:April 19 1999 9:02pm
Subject:Re: LOAD DATA Question
View as plain text  
At 3:34 PM -0500 4/19/99, Balthasar Indermuehle wrote:
>Hi all,
>I'm trying to bulk load data on a regular schedule from a file. The
>problem is this: The first column contains an index number which is
>generated by the data output mechanism "on the other side" which I
>cannot change. Every data file starts again with index 1. My table is
>defined as having the first column an auto_number; LOAD DATA IGNORE
>drops all new records, LOAD DATA REPLACE replaces what's already
>there... what can I do to have the new records just appended, the first
>column ignored and inserted as defined in the table, namely as

There are a couple of possibilities:

(1) strip off the first column with some UNIX utility or a Perl
script, or something similar, then use LOAD DATA to read the result.

(2) load the file as is into a temporary table with the same structure
as your "real" table, then use a INSERT INTO real_table ... SELECT FROM
tmp_table ... statement that inserts all columns *except* that first
column.  That way your auto_increment column will be incremented properly.

Paul DuBois, paul@stripped
Northern League Chronicles:
LOAD DATA QuestionBalthasar Indermuehle20 Apr
  • Re: LOAD DATA QuestionThimble Smith20 Apr
    • Re: LOAD DATA QuestionThimble Smith20 Apr
  • Re: LOAD DATA QuestionEduardo Arino de la Rubia20 Apr
  • Re: LOAD DATA QuestionPaul DuBois20 Apr