Skip to main content

syntax error at or near "\" at end of the query

  • July 28, 2014
  • 4 replies
  • 28 views

James_Pettyjohn
Forum|alt.badge.img
I'm trying to use vertica with Golang over ODBC. I can connect OK and am getting an error of "Syntax error at or near "\" at character 31"  for the query "select * from public.value_ref" - character 31 would be after the last letter of the table. No variations to the query have resolved error. This does work through JDBC and isql over ODBC with this same DSN.

4 replies

James_Pettyjohn
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • July 28, 2014
For anyone else who runs into this, the code.google.com/p/odbc driver appends a null termination character to every query. This doesn't play well with vertica.

Allan_Cochrane_1
Forum|alt.badge.img
  • Participating Frequently
  • August 2, 2014
Did you manage to get the driver working at all? If so, what changes did you make?

James_Pettyjohn
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • August 2, 2014
I did manage to get it working by a quick hack to https://code.google.com/p/odbc/source/browse/odbcstmt.go - I added this to line 39:
b=b[0:len(b)-1]
I didn't look into this further as to which was is per spec so I don't know where this chagne should be implemented.

Allan_Cochrane_1
Forum|alt.badge.img
  • Participating Frequently
  • August 8, 2014