Easysoft ODBC-SQL Server Driver

I get an ORA-02070 error when using DG4ODBC to insert data into SQL Server. What can I do?

Article:
01066
Last Reviewed:
29th January 2024
Revision:
1

Oracle DG4ODBC does not support functions within INSERT statements. If you attempt to do this, you will get an ORA-02070 error. For example:

insert into vc@odbc ("c1") values (current_timestamp);
ORA-02070: database ODBC does not support operator 293 in this context
insert into vc@odbc ("c1") values (sysdate);
ORA-02070: database ODBC does not support special functions in this context

We worked around this issue in the following way:

  1. We created this SQL Server table:
    create table vc ( c0 int IDENTITY(1,1) NOT NULL, c1 datetime, primary key (c0))
  2. Next, we tried to run one of the INSERT statements shown above, but got the ORA-02070 error. To work around this, we passed the contents of the function into a data store and then passed the data store to the INSERT statement. For example:
    DECLARE
    d1 date;
    BEGIN
    select sysdate into d1 from dual;
    INSERT INTO vc@odbc ("c1") values (d1);
    END;/
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from vc@odbc;
    
            c0 c1
    ---------- ---------
             1 03-MAR-14
    
See Also
Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)