Re: using different database (SID) in a subselect with SQL*Plus / Shell Scripts

From: Sven Aluoor <aluoor_at_gmail.com>
Date: Wed, 23 Nov 2011 17:01:45 +0100
Message-ID: <CANqyDm2n2obGcNPpgswOayHwkheOhDby5Cvi6E3YU5KnO+cguQ_at_mail.gmail.com>



On Wed, Nov 23, 2011 at 4:47 PM, Powell, Mark <mark.powell2_at_hp.com> wrote:
> On the database you are connecting to you would create a database link to the remote database and then either reference the link in the sub-select or create a synonym for the remote object that provides the link:
>
> Select testfield from test2_at_remote

Thaks Mark.

CREATE DATABASE LINK local

   CONNECT TO hr IDENTIFIED BY password
   USING 'local';

After this database link is created, hr can query tables in the schema hr on the local database in this manner:

SELECT * FROM employees_at_local;

http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_5005.htm

cheers Sven

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Nov 23 2011 - 10:01:45 CST

Original text of this message