1

I'm working on importing a very large CSV file into SQLite. My understanding is that LOAD DATA INFILE is my best bet. I've created a table for it to reside in, and am attempting to execute the following query

LOAD DATA LOCAL INFILE 'F:/Downloads/NielsonReport.csv' 
INTO TABLE neilson;
IGNORE 1 LINES

but, I get the following error:

Error while executing SQL query on database 'test': near "LOAD": syntax error

I seem to be getting an error along these lines regardless of what I'm trying to execute.

I feel like I'm missing something very basic, and would appreciate any help resolving this problem (I've been referencing this page for information so far)

MikeT
  • 51,415
  • 16
  • 49
  • 68
Jordan Lovell
  • 11
  • 1
  • 3

2 Answers2

1

When you are using SQLite, it would be a good idea to reference the SQLite documentation instead.

Anyway, SQLite itself does not have a CSV import function. But the sqlite3 command-line shell allows to import CSV files with the .import command.

CL.
  • 173,858
  • 17
  • 217
  • 259
-1

Use import command like this.

.import '/Users/haseeb/Desktop/names_data.txt' Names
Haseeb Mir
  • 928
  • 1
  • 13
  • 22