FreeTD Character / in columnname

113 Views Asked by At

I am using FREETDS between two databases Oracle and SYBASE. My Query is running on the oracle database. The Sybase DB is connect by DBLINK thru the ODBC Gateway based on freetds. The query is:

Select NAME, SURNAME, /ORT1/HAMBURG from MIKE

In that case I get the following error on the Query:

ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[FreeTDS][SQL Server]Incorrect syntax near '/'.
{42000,NativeErr = 102}
ORA-02063: preceding 3 lines from MAHRENS
28500. 00000 -  "connection from ORACLE to a non-Oracle system returned this message:"
*Cause:    The cause is explained in the forwarded message.
*Action:   See the non-Oracle system's documentation of the forwarded message.

Any help will be appreciated

Thanks Michael

1

There are 1 best solutions below

4
slaakso On

Oracle uses double quotes to escape special characters and Sybase uses brackets. So you can use either:

Select NAME, SURNAME, "/ORT1/HAMBURG" from MIKE

or

Select NAME, SURNAME, [/ORT1/HAMBURG] from MIKE

Or, make an view based for the table and use that.