insert query help

Hello

i want help to load data from file into mysql DB
this part i know how to do
but during loading
i want to combine 2 fields into 1 field and insert into db as primary key in new column

thanks advice how to do so

Do you mean something like

INSERT INTO table SET column=CONCAT("A", "B") ...

?

i am using following query

load data infile '/home/DEBUG.txt'into table DEB

how to add the extra field which is combination of 2 fields ?

can you give me full example ?

That really depends on what the contents of DEBUG.txt are. Its contents may need to be modified with a shell script or the like before insertion.

mysql -uroot -Dxy -p259 -e "TRUNCATE allev; 
load data infile '/tmp/test.log' into table 
  allev (server_name,test_name,start_Date,end_date,outage_time,old_status,current_status,error_code)
  set pk_number=CONCAT("test_name","start_Date") FIELDS TERMINATED BY ' ';"

why this query give me error ?
the fields terminated by space,, but cant do this

So this statement is inside DEBUG.txt ? I don't think you can put statements inside loaded data...

Unless you just changed the filename, then we need the contents of test.log...

What's PK_number?

You have a string inside double quotes, which contains double quotes, which will confuse the shell. Any double-quotes which aren't supposed to end the string should be escaped like \"

---------- Post updated at 01:07 PM ---------- Previous update was at 01:04 PM ----------

This is getting confused by your previous attempts to solve this. How about, you just show us the contents of the text file(or example data resembling it), the layout of the table, and which columns are supposed to be which.