0

I find it hard to imagine that this question hasn't been asked before, but I couldn't find it.

I would like to use Linq2Db for Sybase and I need to change the identifier quoting characters from [ and ] to " and ", which is what Sybase uses. Is there anyway to do this? I tried looking at the linq2db source code once and it appears that these characters are hard coded, but I'm not sure (I think it would be silly to hard code them). Using Linq2db as it comes always produces errors around the "[" when Sybase executes the queries.

This is Sybase ASE 12.5, and it does not like [];

Here are some sample queries and the error message:

set quoted_identifier on
select * from "client" where clnt_id=140
select * from [client] where clnt_id=140

the first query works, but the second gives:

Incorrect syntax near '['. [SQLCODE=102, SQLSTATE="42000", Server=testtrng_ss1, Severity Level=15, State=1, Transaction State=1, Line=3]

John
  • 357
  • 2
  • 7
  • Sybase [seems to indicate](http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36271.1572/html/blocks/blocks307.htm) using brackets `[`,`]` is normal and using quotes is an option `"`,`"`. – NetMage Jul 31 '18 at 19:09
  • Which Sybase RDBMS product (ASE? SQLAnywhere? IQ? Advantage?) and version?; if ASE then @NetMage is correct, ASE allows both constructs; see [this recent post](https://stackoverflow.com/a/51584613/7366100) for an example of using both; it would help if you could update your question with the same code being submitted to Sybase and the complete error message. – markp-fuso Aug 01 '18 at 12:41
  • It appears that latter version of Sybase ASE DO indeed recognize the [] as identifier quotes. I was able to run this same test on version 16 and it worked. So I still need a way to change the quote characters in linq2db if I want to use it on older Sybase ASE databases. – John Aug 09 '18 at 16:25

0 Answers0