5 Replies Latest reply: May 12, 2013 4:24 AM by User353235 RSS

    Querying Arabic data returns junk characters

    User353235
      Hi,

      I am getting junk characters while querying MS SQL 2008 table from gateway connection (db lilnks). Below are the initialization parameters i am using for DG4ODBC.
      ##########################
      HS_FDS_CONNECT_INFO = mssql
      HS_FDS_TRACE_LEVEL = off
      HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so
      HS_FDS_SUPPORT_STATISTICS=FALSE
      HS_LANGUAGE = AMERICAN_AMERICA.AR8MSWIN1256
      HS_NLS_NCHAR=UCS2
      ##########################

      I tried this with SQLPLUS and Putty, both gives different junk characters.

      Database version: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
      PL/SQL Release 11.1.0.7.0 - Production
      CORE 11.1.0.7.0 Production
      TNS for Linux: Version 11.1.0.7.0 - Production
      NLSRTL Version 11.1.0.7.0 - Production

      DG4ODBC version:
      Heterogeneous Agent Release 11.1.0.7.0 - 64bit Production Built with
      Oracle Database Gateway for ODBC

      OS : RHELinux 5 - 64 bit

      Than You,
      Mohammed.

      Edited by: 906610 on Mar 11, 2013 7:17 AM
        • 1. Re: Querying Arabic data returns junk characters
          damorgan
          What you posted is inadequate to help you. We don't know if issue is what you are retrieving, the operating system, or the tool you are using to look at what is in the Oracle database. We don't even know the Oracle data type or NLS settings.

          After you have inserted a row into Oracle run the following query:
          SELECT <your_column_name>, DUMP(<your_column_name>)
          FROM <your_table_name>;
          and post the DDL for the table.
          • 2. Re: Querying Arabic data returns junk characters
            User353235
            Hi Damorgan,

            Thank's for you reply. I am trying to query a table "Areas" which resides in sql server 2008 database from oracle using dgblink. The Data except the Arabic text is retrieved correctly while only Arabic characters are appearing as some junk characters. the column name which is having Arabic data is "Area_Description". The sql statement i used is SELECT "Area_Description" FROM "Areas"@sqlserver;.
            I tried this sql using Putty and "sqlplus" from widows command prompt. When i am trying this with sqldeveloper tool, it does not give any output and goes into loop untill i close that session after long time.
            The sql server database is using collation for all tables. The collation used for this sql server database is "Arabic_CI_AS".


            SQL> SELECT "Area_Description", DUMP("Area_Description") FROM "Areas"@sqlserver;
            ERROR:
            ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
            ORA-02063: preceding line from SQLSERVER


            no rows selected


            Oracle database NLS_PARAMETERS:
            SQL> SELECT * FROM V$NLS_PARAMETERS;

            PARAMETER VALUE
            ---------------------------------------------------------------- ----------------------------------------------------------------
            NLS_LANGUAGE AMERICAN
            NLS_TERRITORY AMERICA
            NLS_CURRENCY $
            NLS_ISO_CURRENCY AMERICA
            NLS_NUMERIC_CHARACTERS .,
            NLS_CALENDAR GREGORIAN
            NLS_DATE_FORMAT DD-MON-RR
            NLS_DATE_LANGUAGE AMERICAN
            NLS_CHARACTERSET AR8MSWIN1256
            NLS_SORT BINARY
            NLS_TIME_FORMAT HH.MI.SSXFF AM
            NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
            NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
            NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
            NLS_DUAL_CURRENCY $
            NLS_NCHAR_CHARACTERSET AL16UTF16
            NLS_COMP BINARY
            NLS_LENGTH_SEMANTICS BYTE
            NLS_NCHAR_CONV_EXCP FALSE


            Thank You,
            Mohammed.

            Edited by: 906610 on Mar 11, 2013 11:27 PM
            • 3. Re: Querying Arabic data returns junk characters
              Sergiusz Wolicki-Oracle
              What is the data type of the column in SQL Server?


              -- Sergiusz
              • 4. Re: Querying Arabic data returns junk characters
                damorgan
                And, as I asked before, what it the data type/variable type, in Oracle?

                We can not help you if you don't answer all questions completely.
                • 5. Re: Querying Arabic data returns junk characters
                  User353235
                  Installing the newer version of gateway software resolved this issue.
                  Many thanks for all replies.