Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- row1:1,2,3,4,5,6
- row2:1,2,3,4,5,6
- col1 col2
- ===== ====
- 1 3
- 1 3
- col1 col2 col3
- ===== ==== ====
- 1 3 5
- 1 3 5
- load data
- infile *
- insert into table T1 fields terminated by ',' TRAILING NULLCOLS
- (col1,fill1 filler,col2)
- insert into table T2 fields terminated by ',' TRAILING NULLCOLS
- (col1,fill2 filler,col2,fill3 filler,col3)
- begindata
- 1,2,3,4,5,6
- 1,2,3,4,5,6
- load data
- infile *
- truncate
- into table T1
- fields terminated by ',' trailing nullcols
- ( col1
- , fill1 filler
- , col2 )
- into table T2
- fields terminated by ',' trailing nullcols
- ( col1 position(1)
- , filler filler
- , col2
- , filler2 filler
- , col3 )
- BEGINDATA
- 1,2,3,4,5,6
- 1,2,3,4,5,6
- SQL> select * From t1;
- COL1 COL2
- ---------- ----------
- 1 3
- 1 3
- SQL> select* From t2;
- COL1 COL2 COL3
- ---------- ---------- ----------
- 1 3 5
- 1 3 5
- LOAD DATA
- INFILE *
- INSERT INTO TABLE T1 FIELDS TERMINATED BY ',' TRAILING NULLCOLS
- (COL1, FILL2 FILLER, COL2, FILL4 FILLER, FILL5 FILLER, FILL6 FILLER)
- INSERT INTO TABLE T2 FIELDS TERMINATED BY ',' TRAILING NULLCOLS
- (COL1, FILL2 FILLER, COL2, FILL3 FILLER, COL3, FILL6 FILLER)
- BEGINDATA
- 1,2,3,4,5,6
- 1,2,3,4,5,6
Add Comment
Please, Sign In to add comment