Delete or Update Statement Using TG4MSQL 10.2 or DG4ODBC 11.2 Referencing Nvarchar Field In Where Clause Gives ORA-2070 Error

(Doc ID 457473.1)

Last updated on JANUARY 19, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.1 to 11.2.0.2 [Release 11.2]
Oracle Database Gateway for SQL Server - Version 10.2 and later
Information in this document applies to any platform.

Symptoms

A delete or update statement against a SQL*Server table using Transparent Gateway for SQL*Server (TG4MSQL) or Database Gateway for ODBC (DG4ODBC) 11.2 gives an ORA-2070 error if a NVARCHAR column is referenced in the 'where' clause.
The problem can also happen using the WVARCHAR datatype.

For example -

 

SQL> delete from test_nvarchar@tg4msql where "col1" = '444444444444' ;
delete from test_nvarchar@tg4msql where "col1" = '444444444444'
*
ERROR at line 1:
ORA-02070: database TG4MSQL does not support some function in this context

 "col1" in SQL*Server is defined as nvarchar(128).

The following error may also happen -

SQL> delete from test_nvarchar@tg4msql where "col1" = '444444444444' ;
delete from test_nvarchar@tg4msql where "col1" = '444444444444'
*
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this
message:
[Transparent gateway for MSSQL][A047] Syntax error at line 1 position 49
near
''444444444444'' (one of follows was expected: ) in SQL 'DELETE FROM
"TEST_NVARCHAR" A1 WHERE A1."col1"=N'444444444444''
ORA-02063: preceding 2 lines from TG4MSQL


But this can be prevented by executing the following -

exec dbms_hs.create_inst_caps ('tg4msql','MSSQL10.2.0.3.0_250',564,1,NULL,0);


after which the ORA-2070 error is received.
'MSSQL10.2.0.3.0_250' is the value returned by the following select run as SYS -

select * from HS$_FDS_CLASS where fds_class_name like 'MSSQL%';

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms