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