Feedback
Did this article resolve your question/issue?

   

Article

Using hsodbc, dg4odbc with SQL Server Unicode datatypes NVARCHAR, NCHAR, NTEXT

« Go Back

Information

 
TitleUsing hsodbc, dg4odbc with SQL Server Unicode datatypes NVARCHAR, NCHAR, NTEXT
URL Name3086
Article Number000147755
EnvironmentProduct: Connect(64) for ODBC SQL Server Legacy Wire Protocol driver
Version: All supported versions
OS: All UNIX/Linux
Database: SQL Server
Application: Oracle Database Gateway for ODBC, Oracle Heterogeneous Services
Question/Problem Description

On UNIX/Linux when attempting to fetch tables with N* SQL Server datatype columns (NCHAR, NVARCHAR, NTEXT), Oracle Heterogeneous Services (hsodbc) will return one of the errors below.

This works on Windows platforms.

 

Steps to Reproduce
Clarifying Information
Error MessageORA-00942 - Table or view does not exist
or
ORA-03113: end-of-file on communication channel
or
[DataDirect][ODBC SQL Server Driver][SQLServer]Invalid object name
Defect NumberEnhancement DEF0002148
Enhancement Number
Cause

The root cause is that hsodbc is not able to handle unicode data types.  However, dg4odbc can handle these datatypes if Oracle DB Character Set = Unicode.

On some Oracle platforms retrieving TEXT and NTEXT fields still fails with errors like ORA-03113: end-of-file on communication channel. This most likely has to do with hsodbc attempting to allocate memory with a size the max size of a CLOB.

Resolution

Enhancement request DEF0002148 was logged for this issue and is implemented in 32-bit SQL Server Legacy Wire Protocol driver build 5.10.0094.

A connection option has been added to the SQL Server Legacy WP driver: EnableSQLWCHAR

When set to 1 (default) the Connect for ODBC driver for MS SQL Server describes the SQL Server nchar type as SQL_WCHAR and if set to 0 the driver will describe it as SQL_CHAR.

To resolve the above errors, add  the connection attribute EnableSQLWCHAR=0 to the data source in the odbc.ini file.

--

For the Sybase ODBC driver to report unicode datatypes as ANSI datatypes for use with hsodbc use the connection option DescribeUTF8AsUnicode=0

Workaround
Notes
Last Modified Date9/13/2015 4:52 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.