Hi,

I have some text files (logs) that are tab delimited containing 3 columns.
I'm loading them into MySql using the LOAD DATA LOCAL INFILE commands, but I
want to load them into a table that has 4 fields, with the 4th field having
a value equal to the name of the file being loaded.

Is this possible? I thought of something like this: 

LOAD DATA LOCAL INFILE 'something.txt' INTO TABLE test.data (FIELD1, FIELD2,
FIELD3, FIELD4 = 'something.txt')

but that doesn't work.  I seem to recall doing something similar a few years
back but using Micro$oft SQL server.

I suppose that I could pre-process the file before loading it to add the
extra column, but that seems like a long winded way of doing it (the files
being imported have hundreds of thousands of rows).

Any thoughts?

Kind Regards,

Martyn

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