Skip to Main Content

SQL & PL/SQL

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!

Oracle query on dblinked SQL Server tables returns ORA-00904 error

337552Sep 22 2009 — edited Sep 22 2009
Hi,

I have created a dblink to a SQL Server database from Oracle using Generic Connectivity.
The following query returns ORA-00904 Invalid Identifier error in the WHERE clause (tblEmp.Empno)

SELECT "EmpNo","EmpName", "DeptName"
FROM tblEmp@sqlserver,
tblDept@sqlserver
WHERE tblDept.DeptNo = tblEmp.Empno

I had to enclose the column names in double quotes due to case sensitivitiy of the columns, but I can't do the
same for the WHERE clause.

1) So, how do I fix this error ?
2) Also how do I include Deptno column with table alias in the columns list?
(Deptno is ambiguous in Emp and Dept tables)

Regards,
Sam
This post has been answered by 21205 on Sep 22 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2009
Added on Sep 22 2009
18 comments
2,364 views