Carol.Kar
Carol.Kar

Reputation: 5345

Import csv file in hsqldb

I tried to import a csv file into hsqldb by:

COPY TestDATA FROM 'C:/Users/Desktop/Data.csv' DELIMITER ';' CSV;

However, I am only getting an error:

unexpected token: COPY / Error Code: -5581 / State: 42581

Is this possible in hsqldb? If not, whats another way to import a csv in hsqldb?

I appreciate your replies!

Upvotes: 0

Views: 8950

Answers (1)

fredt
fredt

Reputation: 24352

There are two ways to import CSV files:

  1. Use the SqlTool command line app to copy into a normal table http://hsqldb.org/doc/2.0/util-guide/sqltool-chapt.html#sqltool_dsv-sect

  2. Create a TEXT table with the CSV file as its data source http://hsqldb.org/doc/2.0/guide/texttables-chapt.html The contents of the TEXT table can then be copied into a normal table.

Upvotes: 3

Related Questions