# Interesting APEX with dblink issue

We recently ran in to a problem when connecting across a database link to a Postgres database.  The query looked like this  

> select "column1", "column2"  
>   from "my\_schema"."my\_long\_named\_view"@my\_db\_link  

It works fine from sql\*plus and sql Developer, but when running the same query in Application Express (in an app or in the SQL Workshop) we got this error:  

> ORA-28500: connection from ORACLE to a non-Oracle system returned this message: \[Generic Connectivity Using ODBC\]DRV\_QspecDescribe: DB\_ODBC\_RECORD (189): ; \[OpenLink\]\[ODBC\]\[PostgreSQL Server\] current transaction is aborted, commands ignored until end of transaction block (SQL State: S1000; SQL Code: 1) ORA-02063: preceding 2 lines from MY\_DB\_LINK  

Dave Rydzewski came up with the solution.  Shorten the name of the view in Postgres and change the query to look like this (note two fewer double quotes "):  

> select "column1", "column2"  
>   from "my\_schema.short\_v"@my\_db\_link  

I'm still not sure what APEX does to make it blow up.  I wonder how many people use APEX with a db link to Postgres.
