Csvjdbc can read CSV files with column names and/or column values containing spaces. For example, the following CSV file can be read:
FIRST NAME,LAST NAME,AGE
JOE,CITIZEN,33
FRED,BLOGGS,44
ANNE MARIE,SMITH,22
MARK,CARTER LLOYD,66
However, you do have to be careful using these column names in SQL queries and use double-quotes around column names with spaces, so that the SQL statement can be understood by the computer. For example,
select "FIRST NAME", "LAST NAME", AGE from sample
Last edit: Simon Chenery 2019-05-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
Any solution in the updated version for coulmns to allow spaces in between e.g FIRST NAME
Kindly suggest any workaround ?
Thanks
Bhuvana
Csvjdbc can read CSV files with column names and/or column values containing spaces. For example, the following CSV file can be read:
However, you do have to be careful using these column names in SQL queries and use double-quotes around column names with spaces, so that the SQL statement can be understood by the computer. For example,
select "FIRST NAME", "LAST NAME", AGE from sample
Last edit: Simon Chenery 2019-05-09
HI Simon,
However im getting error message as 'Table contains duplicate column names' when I do supress headers = false.
I need headers to use columns names in query filter condu=ition (e.g Where column1 = value)
Thanks
Hi Simon ,
I mean column name space in WHERE clause and not in Select like below,
ResultSet results = stmt.executeQuery ("Select * from sample where FIRST NAME = 'ABC' ");
When I execute this stmt im getting below error,
Syntax error: Encountered " <name> "NAME "" at line 1, column 49.
Was expecting:
<eof> </eof></name>
Got it.. Thanks.