Jdbc-elasticsearch table names with hyphens


#1

Hello, any jdbc-elasticsearch users here who can help me figure out how to query data from MS SQL servers which have table names containing hyphens? I can't seem to get around the following error...

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '-'.

My select statement is as follows...

 "sql":"select * from TEST_Live-Orders",

Kind regards,


(Magnus B├Ąck) #2

Have you tried quoting the table name with square brackets?


#3

Hi Magnus, thanks for the reply. I have and that didn't work either. I'm guessing I have to do something special with the jdbc script or something.


#4

Hi again Magnus, that actually worked. When I had first tried brackets I had other syntax issues. Thanks a bunch!


(system) #5