1 2 Previous Next 18 Replies Latest reply: Feb 10, 2012 6:52 AM by 916508 Go to original post RSS
      • 15. Re: Again Oracle to MSSQL with Unixodbc and freetds
        Kgronau-Oracle
        the columns are all nvarchars - so you need to add also HS_NLS_NCHAR = UCS2 (a SQL Server uses UCS2 as unicode character set).
        But with or without this parameter using FreeTDS 0.82 the select works.

        Will try to get 0.92 FreeTDS. In the meantime, could you please create an ODBC trace?
        ODBC tracing is generated by adding to the odbcinst.ini file a section [ODBC] (if it does not yet exist) and add these lines to it:
        [ODBC]
        TraceFile=/tmp/sql.log
        Trace=1

        Now the ODBC calls will be logged in /tmp/sql.log.
        Please don't post the log to the thread - instead use a free upload server and upload the file to it.

        Edited by: kgronau on Feb 10, 2012 12:50 PM
        For example use http://dl.dropbox.com

        Edited by: kgronau on Feb 10, 2012 1:26 PM


        Applied 0.92 ODBC driver and it works for me ...

        Here's the config file I'm using:
        # needed for the Database Gateway for ODBC

        #
        # HS init parameters
        #
        HS_FDS_CONNECT_INFO = FreeTDS

        HS_FDS_TRACE_LEVEL=255
        HS_FDS_SHAREABLE_NAME =/home/odbc64/unixODBC/2.3/lib/libodbc.so
        HS_NLS_NCHAR = UCS2
        HS_LANGUAGE=american_america.we8mswin1252

        set ODBCINI=/home/odbc64/odbc.ini
        set ODBCINSTINI=/home/odbc64/odbcinst.ini
        HS_KEEP_REMOTE_COLUMN_SIZE=ALL
        HS_NLS_LENGTH_SEMANTICS=CHAR
        HS_FDS_SUPPORT_STATISTICS=FALSE

        and my odbc.ini:
        [FreeTDS]
        #Driver = /home/odbc64/FreeTDS/0.82/lib/libtdsodbc.so
        Driver =/home/odbc64/FreeTDS/0.91/lib/libtdsodbc.so
        Server = xxx
        Database = AdventureWorks
        Port = 1433
        TDS_Version = 8.0

        => the TDS_VERSION I'm using is different
        • 16. Re: Again Oracle to MSSQL with Unixodbc and freetds
          916508
          Thank you,

          it doesnt work with trace, but i think its not worth to invest more time of you.
          I created a other table in some schemas and they all worked perfekt.

          But last question can you post me the syntax for a query of two or more colums?

          so if i do select column1,column2 from person.address@mssql; i get an syntax error.
          • 17. Re: Again Oracle to MSSQL with Unixodbc and freetds
            Kgronau-Oracle
            My SQL Server is case sensitive, so I have to surround all table/column names by double quotes. The statement to select the first three columns looks like:
            select "AddressID","AddressLine1","City" from "Person"."Address"@FREETDS;
            and it returns:
            AddressID AddressLine1 City
            ---------- ------------------------------------------------------------ ------------------------------
            532 #500-75 O'Connor Street Ottawa
            497 #9900 2700 Production Way Burnaby
            29781 00, rue Saint-Lazare Dunkerque
            ....
            • 18. Re: Again Oracle to MSSQL with Unixodbc and freetds
              916508
              You are the one!

              Thank you for the gigantic help :)
              1 2 Previous Next