Ah, Thanks for the info.. Unfortunately, I already started things out
using mysqldump -c so it just creates complete insert statements. I
would be a little difficult to change things now. I will either have to
consider changing the way the dump files are created and then use LOAD
DATA, or just analyze the first INSERT statement in my dump file and 1)
temporarily add non-existing columns, 2) load the data (by just running
the insert statements), and then 3) drop the temp columns.
Thanks again,
Davy
[EMAIL PROTECTED] wrote:
How are you processing the incoming file (what command are you using
to read your dump table)? If you are using LOAD DATA INFILE, there is
a way to tell it to skip certain fields (and to create values for
missing fields). If you are using a script (like those produced from
mysqldump), you will need to load that data into a staging table then
create your own INSERT statement using your freshly imported data as
its source.
http://dev.mysql.com/doc/mysql/en/load-data.html
>>>>>>>>>>>>>>>>>>>
By default, when no column list is provided at the end of the LOAD
DATA INFILE statement, input lines are expected to contain a field for
each table column. If you want to load only some of a table's columns,
specify a column list:
mysql> LOAD DATA INFILE 'persondata.txt'
-> INTO TABLE persondata (col1,col2,...);
You must also specify a column list if the order of the fields in the
input file differs from the order of the columns in the table.
Otherwise, MySQL cannot tell how to match up input fields with table
columns.
If an input line has too many fields, the extra fields are ignored and
the number of warnings is incremented.
If an input line has too few fields, the table columns for which input
fields are missing are set to their default values. Default value
assignment is described in Section 13.2.5, “CREATE TABLE Syntax”.
An empty field value is interpreted differently than if the field
value is missing:
*
For string types, the column is set to the empty string.
*
For numeric types, the column is set to 0.
*
For date and time types, the column is set to the appropriate ``zero''
value for the type. See Section 11.3, “Date and Time Types”.
<<<<<<<<<<<<<<<<<
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]