Menu

Column Name spaces

Help
Bhuvana
2019-05-09
2019-05-20
  • Bhuvana

    Bhuvana - 2019-05-09

    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

     
  • Simon Chenery

    Simon Chenery - 2019-05-09

    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
  • Bhuvana

    Bhuvana - 2019-05-10

    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

     
  • Bhuvana

    Bhuvana - 2019-05-17

    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>

     
  • Bhuvana

    Bhuvana - 2019-05-20

    Got it.. Thanks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.