blob: 2b25435fa7ac776b4759da1d5f5c7f6946bc0e4a (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
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 ',' (a,b);
SELECT a,b 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 '/' (a,b);
SELECT a,b FROM t1;
a b
1 foo
1 foo
2 bar
2 bar
3
3
4 abc
4 abc
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 a,b FROM t1;
a b
0 loaded
1 foo
1 foo
102 loaded
2 bar
2 bar
3
3
4 abc
4 abc
5 loaded
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 a,b 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
LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1;
SELECT a,b FROM t1;
a b
0
0 loaded
1 foo
1 foo
1 foo
100 foo
102 loaded
2 bar
2 bar
2 bar
3
3
3
4 abc
4 abc
4 abc
5 loaded
7 test
DROP TABLE t1;
|