MySQL Forums
Forum List  »  Data Warehouse

LOAD DATA INFILE with SET commad
Posted by: chiko Ratnayake
Date: April 19, 2011 06:29AM

hi I need to insert bb.csv file data which col1=12
cat bb.csv
1,1,41|
19,2,40662432|
12,3,47006477|
19,4,46124433|

table:
+-----------------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+----------+------+-----+---------+-------+
| service_key | int(6) | YES | | NULL | |
| subscriber_type | char(6) | YES | | NULL | |
| call_type | char(15) | YES | | NULL | |
+-----------------+----------+------+-----+---------+-------+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=

commad:
mysql>LOAD DATA INFILE '/data/PREPAID/gg.csv' INTO TABLE test fields TERMINATED BY ',' LINES TERMINATED BY '|' (service_key,@subscriber_type,call_type) SET service_key =12;

Query OK, 4 rows affected, 1 warning (0.24 sec)
Records: 4 Deleted: 0 Skipped: 0 Warnings: 0

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
here all the data will inserted. how to avoid this issue. i need only one record to be inserted.
great help
thanks
great

Options: ReplyQuote


Subject
Views
Written By
Posted
LOAD DATA INFILE with SET commad
4938
April 19, 2011 06:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.