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

From: Sven Aluoor <>
Date: Wed, 23 Nov 2011 16:37:51 +0100
Message-ID: <>


I have this simplified SQL statement within Shell Script.

function ()
sqlplus -S $DBO/$DBOPW_at_$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

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

Received on Wed Nov 23 2011 - 09:37:51 CST

Original text of this message