Bug #1524 | Can you load from flat files with fixed positions? | ||
---|---|---|---|
Submitted: | 10 Oct 2003 11:48 | Modified: | 13 Oct 2003 5:34 |
Reporter: | Udi Karni | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S4 (Feature request) |
Version: | 4.0.15 | OS: | Windows (Windows) |
Assigned to: | Sergei Golubchik | CPU Architecture: | Any |
[10 Oct 2003 11:48]
Udi Karni
[12 Oct 2003 19:32]
MySQL Verification Team
Sergei we have plans in the future for that import option ?
[13 Oct 2003 5:34]
Dmitry Lenev
1) I should note that you can achieve desired result even with current LOAD DATA using its ability to work with fixed-row file format (although it may require creating of temporary table if field widths in your file differ from display widths of columns in target table). Please, read documentation on this subject at http://www.mysql.com/doc/en/LOAD_DATA.html 2) Also we are going to support extended syntax for LOAD DATA which will allow you to use construction similar to next statement: LOAD DATA INFILE 'data.txt' INTO TABLE sometable FIELDS TERMINATED BY '#somebogussymbol' (@a) SET pid=mid(@a,1,10), name=mid(@a,11,30), addr=mid(@a,41,40); So instead of direct loading of parts of the string from 'data.txt' into fields of table, you load each string in variable and then fill fields with parts of variable value. It is not yet known will this feature appear in 4.1 or in 5.0 (it will likely to break 4.1 -> 4.0 replication in first case...) Thank you for your interest in MySQL Udi!