Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 447

I'm trying to load a flat file into Mariadb. My code works on a different database, but on this data / db, I get a 1064 error

$
0
0

This code (truncated) works:

    SET GLOBAL local_infile = 'ON';    SHOW GLOBAL VARIABLES LIKE 'local_infile';    LOAD DATA LOCAL INFILE 'E:\\MM012224.txt'    INTO TABLE `denton24`.`mm012224`    (@row)    SET Account_Number = TRIM(SUBSTR(@ROW,1,30)),    SPTB_Code = TRIM(SUBSTR(@ROW,31,3)),

BUT THEN THIS SIMILAR CODE DOES not WORK [error 1064 - you have an error in your SQL syntax]:

    SET GLOBAL local_infile = 'ON';    SHOW GLOBAL VARIABLES LIKE 'local_infile';    LOAD DATA LOCAL INFILE 'E:\\tax_roll.txt'    INTO TABLE `dallas24`.`tax_roll`    (@row)    SET ACCOUNT = TRIM(SUBSTR(@ROW,1,34)),    SET YEAR = TRIM(SUBSTR(@ROW,35,4)),    SET JURISDICTION = TRIM(SUBSTR(@ROW,39,4)),

I have tried to look at system variables to see if there's a system variable that needs changed, but I'm a neophyte in that area. I did confirm my account does have FILE permission.

The (@row) use inputs the flat file by parsing the location of the various fields using TRIM(SUBSTR(@ROW,1,34))

The syntax appears identical, but one works and the other does not.


Viewing all articles
Browse latest Browse all 447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>