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

  • From: "Powell, Mark" <mark.powell2@xxxxxx>
  • To: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 23 Nov 2011 15:47:57 +0000

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@remote

HTH -- Mark D Powell --


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Sven Aluoor
Sent: Wednesday, November 23, 2011 10:38 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: using different database (SID) in a subselect with SQL*Plus / Shell 
Scripts

Hi

I have this simplified SQL statement within Shell Script.

function ()
{
sqlplus -S $DBO/$DBOPW@$ORACLE_SID <<EOF >
/opt/test/output.$(/bin/date '+%d%m%Y.%Hh')
set echo Off
[...]
set linesize 20000

SELECT testfield from test where testfield not in (select testfield from test2);
exit
EOF
}

The problem is that the subselect (select testfield from test2) is an
other oracle database (not the one connected on with sqlplus).
Howto to that with SQL*Plus and Shell Scripts?

cheers Sven
--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l


Other related posts: