View difference between Paste ID: YKW4WwKP and h113NxNm
SHOW: | | - or go back to the newest paste.
1
LOAD DATA INFILE '/home/myusername/mysql/DRAWINGS.csv' INTO TABLE DwgsTbl
2
        FIELDS TERMINATED BY '|'
3
        ENCLOSED BY '"'
4
        LINES TERMINATED BY '\n'
5
        (QuoteNo, Updated, Keyword1, Keyword2, Material, fSize, DWGNo, Description, @var1, NTS, DOT, Customer, ProjectSpec, DwgSize, Detail, GD, DrawnBy, RecNo, Notes, @var2)
6
        SET createdDate = STR_TO_DATE(@var1, '%c/%e/%Y %H:%i:%s')
7-
        /* SET Revision = IF(LENGTH(@var2) > 0, @var2, 0); */
7+
            Revision = IF(@var2 RLIKE '^[0-9]+$', @var2,0);
8-
        SET Revision = IF(@var2 RLIKE '^[0-9]+$', @var2,0);
8+
9
THIS RETURNS THIS ERROR MESSAGE:
10
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Revision = IF(@var2 RLIKE '^[0-9]+$', @var2,0)' at line 7