When i execute select * from sample column names returned as they defined in CSV: Name, x, y, Epsg.
But select Epsg from sample or select Epsg from sample group by Epsg returns column name in uppercase EPSG.
ResultSet should returns column names in upper case or 'as is' always.
Am i right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For example i have an application server that works with different databases uniformly via jdbc. The same code of application server works with different datasources.
To fix the problem, data access layer, should:
* iteract with datasources in uppcase
* convert resultset column names to uppercase.
But it's a real headache because Oracle, Postgre, ... are case sensitive, and convertion to upper case can't solve the problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you Simon,
It will be better for columns names.
I'm not so sure about the behavior of Oracle, PostgreSQL or MySQL regarding "uncoted" Aliases names (and I'm too far from any computer to test it those days :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Simon,
Is this issue (bug 125) something you think you'll be able to address soon? If not, are you open to pull requests? It's affecting some work that I'm doing and the workaround is tedious...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All.
I have CSV file
sample.csvWhen i execute select * from sample column names returned as they defined in CSV: Name, x, y, Epsg.
But select Epsg from sample or select Epsg from sample group by Epsg returns column name in uppercase EPSG.
ResultSet should returns column names in upper case or 'as is' always.
Am i right?
You are correct.
CsvJdbc should return column names 'as is' for consistency, and not convert column names to uppercase.
CsvJdbc is case-insensitive, so "id", "Id" and "ID" all refer to the same column, so this inconsistency is usually no problem.
Hi Simon.
Thanks for you response.
For example i have an application server that works with different databases uniformly via jdbc. The same code of application server works with different datasources.
To fix the problem, data access layer, should:
* iteract with datasources in uppcase
* convert resultset column names to uppercase.
But it's a real headache because Oracle, Postgre, ... are case sensitive, and convertion to upper case can't solve the problem.
Logged as CsvJdbc bug #125 Return column names in original case used in SQL query.
shouldn't the columns case be the one of the csv file header (not the one used in the query ) ?
@PAscal, your suggestion is more logical. I changed the bug description to state that column names should be the same case as in the csv file header.
Thank you Simon,
It will be better for columns names.
I'm not so sure about the behavior of Oracle, PostgreSQL or MySQL regarding "uncoted" Aliases names (and I'm too far from any computer to test it those days :-)
Simon,
Is this issue (bug 125) something you think you'll be able to address soon? If not, are you open to pull requests? It's affecting some work that I'm doing and the workaround is tedious...
I will fix bug 125 and create a new release by 18.08.2016.
I will also accept a git pull request (either here on SourceForge or on https://github.com/simoc/csvjdbc ), if you want to fix it sooner.
Hi
Simon here my solution https://github.com/simoc/csvjdbc/pull/4
Bug 125 fixed and included in CsvJdbc version 1.0-31.
Thank you for this new release.
Maybe this could also be applied to columns quoted alias
as done in main other RDBMS:
*** MySQL
select 1 as One, 1 as "One"
+-----+-----+
| One | One |
+-----+-----+
| 1 | 1 |
+-----+-----+
*** PostgreSQL
select 1 as One, 1 as "One"
+-------------+-------------+
| one | One |
+-------------+-------------+
| 1 | 1 |
+-------------+-------------+
*** Oracle
select 1 as One, 1 as "One" from dual
+------------------------+------------------------+
| ONE | One |
+------------------------+------------------------+
| 1 | 1 |
+------------------------+------------------------+
*** CsvJdbc 1-0-31
select 1 as One, 1 as "One" FROM tab
+----------------------+----------------------+
| ONE | ONE |
+----------------------+----------------------+
| 1 | 1 |
+----------------------+----------------------+
Yes. This is CsvJdbc bug 126.