# "ORA-02070: database xxx does not support some function in this context" error when trying to update tables via Oracle through dg4odbc

**URL:** <https://community.cdata.com/t/ora-02070-database-xxx-does-not-support-some-function-in-this-context-error-when-trying-to-update-tables-via-oracle-through-dg4odbc/1100>\
**Category:** CData Drivers\
**Tags:** odbc-driver, oracle-error, ora-02070, question, odbc\
**Created:** [May 28, 2025, 6:47pm UTC](https://community.cdata.com/t/ora-02070-database-xxx-does-not-support-some-function-in-this-context-error-when-trying-to-update-tables-via-oracle-through-dg4odbc/1100 "2025-05-28T18:47:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gauravr](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@gauravr](https://community.cdata.com/u/gauravr)\
**Post date:** [May 28, 2025, 6:47pm UTC](https://community.cdata.com/t/ora-02070-database-xxx-does-not-support-some-function-in-this-context-error-when-trying-to-update-tables-via-oracle-through-dg4odbc/1100/1 "2025-05-28T18:47:39Z")

</div>

When connected to my data source&nbsp;as a Remote Oracle Database via the ODBC Driver, I run into the following error when trying to perform inserts or updates into my database:

_Error ORA-02070: database xxx does not support \<operation\>&nbsp;in this context_

or

_ORA-02070: database xxx does not support some function in this context_

I am connected via the Database Gateway dg4odbc.&nbsp;How can I resolve this issue?

---

<div class="post-metadata">

**Author:** ![gauravr](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@gauravr](https://community.cdata.com/u/gauravr)\
**Post date:** [May 28, 2025, 7:13pm UTC](https://community.cdata.com/t/ora-02070-database-xxx-does-not-support-some-function-in-this-context-error-when-trying-to-update-tables-via-oracle-through-dg4odbc/1100/2 "2025-05-28T19:13:39Z")

</div>

Once you are connected to your ODBC Data source via an Oracle tool like SQL Plus, you can perform updates by using a query passthrough approach to push the update to the data source. Try pushing your update in the following format:

```sql
DECLARE c INTEGER; -- Cursor ID for passthrough nr INTEGER; -- Number of rows affectedBEGIN -- Open a passthrough cursor on the remote DB (via DB link) c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@<db_link>; -- Prepare the SQL statement with placeholders DBMS_HS_PASSTHROUGH.PARSE@<db_link>(c, '<your SQL statement with placeholders, e.g., UPDATE ... SET ... WHERE ...>'); -- Bind variables (starting at position 1) DBMS_HS_PASSTHROUGH.BIND_VARIABLE@<db_link>(c, 1, <value1>); DBMS_HS_PASSTHROUGH.BIND_VARIABLE@<db_link>(c, 2, <value2>); -- Add more binds as needed... -- Execute the non-query (INSERT/UPDATE/DELETE) nr := DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@<db_link>(c); -- Optionally display number of affected rows DBMS_OUTPUT.PUT_LINE(nr || ' rows updated'); -- Close the passthrough cursor DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@<db_link>(c);END;

```

You can use this procedure to execute a parameterized SQL statement (e.g., an UPDATE) on a remote non-Oracle database&nbsp;via a database link.

Please make sure to replace **\<db\_link\>** &nbsp;with the actual name of your database link (e.g.,&nbsp; **@myd365db** ).

This template supports **UPDATE** , **INSERT** , or **DELETE** &nbsp;statements.
