How to remove DB link username from tablename prefix? (Ora-04052 error)
644807Sep 26 2009 — edited Nov 23 2011Hi All
I have successfully established heterogenous connectivity between ORACLE 10gR2 and Sybase ASE 15.0.2 using generic HSODBC. I have defined a database link called CSSTAT using:
create database link CSSTAT connect to "fw" identified by "******" using 'CSSTAT';
Using SQLPLUS, I can now query all tables in 'dbo' schema using fully qualified table names such as "csstat.dbo.table_name":
select *
from "csstat.dbo.table_name".CSSTAT;
Now the problem occurs when I have to execute this query from within a PL/SQL block. When I try compiling this code, Oracle throws out 'ORA-04052' error complaining it cannot lookup object fw.csstat.dbo.table_name
The problem is pl/sql compiler is prefixing the qualified table name with DB link username "fw". Is there a way to tell Oracle not to do that?
Funny thing is from SQLPLUS this query runs fine but only through PL/SQL does this throw out an error. How do I go about fixing this?