blob: 85608cdc32a8a1fd1204233f56aba0ef2a6af0bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ',';
SELECT * FROM t1;
a b
1 foo
2 bar
3
4 abc
LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
CHARACTER SET utf8 COLUMNS TERMINATED BY ','
ESCAPED BY '/';
SELECT * FROM t1;
a b
1 foo
1 foo
2 bar
2 bar
3
3
4 abc
4 abc
LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ';'
OPTIONALLY ENCLOSED BY ''''
LINES STARTING BY 'prefix:'
IGNORE 2 LINES
(a,b);
Warnings:
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
SELECT * FROM t1;
a b
0
1 foo
1 foo
100 foo
2 bar
2 bar
3
3
4 abc
4 abc
7 test
LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ';'
(a) SET b='loaded';
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
SELECT * FROM t1;
a b
0
0 loaded
1 foo
1 foo
100 foo
102 loaded
2 bar
2 bar
3
3
4 abc
4 abc
5 loaded
7 test
DROP TABLE t1;
|