Ora-02070: Database %S%S Does Not Support %S in This Context
I Have an Oracle Database from Which I Am Selecting a Table from a Remote Postgres Database, Pg. the Column Mydate Is of Type Date. Select...
I have an Oracle database from which I am selecting a table from a remote postgres database, pg. The column mydate is of type date.
select to_char(mydate,'mm-dd-yyyy') from "pg_table"@pg
For the above query, I am getting an error like
ORA-02070: database PG does not support TO_CHAR in this context
*Cause: The remote database does not support the named capability in the context in which it is used.
*Action: Simplify the SQL statement.
Why is this happening?
2 Answers
Try to use to_date to first make it an oracle date then use to_char to transform
select to_char(to_date(mydate),'mm-dd-yyyy' ) as "Date"
from "pg_table"@pg
Some functions are not supported by the linked server driver to the backend server. I'm having this happen right now where regex_replace is not supported by links to MSSQL. This is just an unfortunate byproduct of using a linked server.