Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Snytax to query from Oracle table using dblink

Status
Not open for further replies.

kvang

Programmer
Oct 7, 2005
129
US
What is the syntax to query a table from Oracle?

I have tried Google, but had no luck. Anyways, here's some information on my database.

I'm trying to write the query in MS SQL Server 2000. The Oracle database is 8i. The linked server name is LOANIMG. Database name is RPT. The schema is REPORTLS and table is WORKTYPES.
 
You could try this.

schemaname.tablename@linkname

select
*
from reportls.wortypes@loanimg

"loanimg" might be an alias, but it should work. To get the full name on the oracle side run on the oracle side.

select * from sys.db.links
 
Ignore the last post, that is coming from the oracle side.

On sql server you can use the openquery function.

SELECT *
FROM OPENQUERY(noanimg, select * from reportls.wortypes') wortypes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top