I've got my linked servers set up and I can query the Postgres dB from MS SQL.
When I try to execute a query on the Postgres server from SQL by issuing the following command:
Code: Select all
EXECUTE ('select * from user_json where data ? ''{}'';') AT [PGTEST-DA]
OLE DB provider "MSDASQL" for linked server "PGTEST-DA" returned message "[Devart][ODBC]COUNT field incorrect".
In this case, it's the presence of the ? (question mark) that appears to be causing the driver to think that I am passing a parameter. I am not. This is an operator in PGSQL for working with JSONB.
I've tried escaping the parameter (Using \\?, \? and ??), but nothing works.
I'm having the same problem with the PostgreSQL ODBC driver as well and I've seen some articles of other people having this problem. This is why I investigated using the Devart driver.
Thank you,
Dave