My Oracle Support Banner

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 MAY 11, 2022

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 -

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Cause
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.