Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2005, 08:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Linking servers

Hello,

I'm trying to write a query that on one server will link to another server's table. For example, say I have two environments, TRN and DEV, and I want in TRN to have my query connect to a table in development. How do I do that?

Something like:

select *
from mySchema.Table1 t
left outer join DEV.mySchema.Table1 d
on t.ID = d.ID

something like that?

Brian
__________________
Brian
 
Old February 5th, 2005, 12:37 AM
Authorized User
 
Join Date: Dec 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Create a database link called TRN from DEV. like,

create database link TRN connect to mySchema identified by <password> using 'TNS_STR';-- create a TNS string and put the name here.

then you can select using,

select *
from mySchema.Table1 t
left outer join Table1@TRN d
on t.ID = d.ID




Sujit Ku. Mahapatra





Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked Servers anothervbaddict SQL Server 2000 5 November 30th, 2007 07:31 AM
Linked Servers rklio SQL Server 2005 0 February 5th, 2007 12:00 PM
Query Between Servers nikotromus SQL Server 2000 2 March 1st, 2006 05:47 AM
Different Servers - Same database itHighway Classic ASP Basics 1 April 19th, 2005 03:27 PM
Linked Servers msrnivas .NET Web Services 1 January 8th, 2005 09:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.