Guest User

Untitled

a guest
Jun 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. row1:1,2,3,4,5,6
  2. row2:1,2,3,4,5,6
  3.  
  4. col1 col2
  5. ===== ====
  6. 1 3
  7. 1 3
  8.  
  9. col1 col2 col3
  10. ===== ==== ====
  11. 1 3 5
  12. 1 3 5
  13.  
  14. load data
  15. infile *
  16. insert into table T1 fields terminated by ',' TRAILING NULLCOLS
  17. (col1,fill1 filler,col2)
  18. insert into table T2 fields terminated by ',' TRAILING NULLCOLS
  19. (col1,fill2 filler,col2,fill3 filler,col3)
  20. begindata
  21. 1,2,3,4,5,6
  22. 1,2,3,4,5,6
  23.  
  24. load data
  25. infile *
  26. truncate
  27. into table T1
  28. fields terminated by ',' trailing nullcols
  29. ( col1
  30. , fill1 filler
  31. , col2 )
  32. into table T2
  33. fields terminated by ',' trailing nullcols
  34. ( col1 position(1)
  35. , filler filler
  36. , col2
  37. , filler2 filler
  38. , col3 )
  39.  
  40. BEGINDATA
  41. 1,2,3,4,5,6
  42. 1,2,3,4,5,6
  43.  
  44. SQL> select * From t1;
  45.  
  46. COL1 COL2
  47. ---------- ----------
  48. 1 3
  49. 1 3
  50.  
  51. SQL> select* From t2;
  52.  
  53. COL1 COL2 COL3
  54. ---------- ---------- ----------
  55. 1 3 5
  56. 1 3 5
  57.  
  58. LOAD DATA
  59. INFILE *
  60. INSERT INTO TABLE T1 FIELDS TERMINATED BY ',' TRAILING NULLCOLS
  61. (COL1, FILL2 FILLER, COL2, FILL4 FILLER, FILL5 FILLER, FILL6 FILLER)
  62. INSERT INTO TABLE T2 FIELDS TERMINATED BY ',' TRAILING NULLCOLS
  63. (COL1, FILL2 FILLER, COL2, FILL3 FILLER, COL3, FILL6 FILLER)
  64. BEGINDATA
  65. 1,2,3,4,5,6
  66. 1,2,3,4,5,6
Add Comment
Please, Sign In to add comment