Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to remove DB link username from tablename prefix? (Ora-04052 error)

644807Sep 26 2009 — edited Nov 23 2011
Hi 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?
This post has been answered by Kgronau-Oracle on Sep 28 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 21 2011
Added on Sep 26 2009
10 comments
4,001 views