Spool in SqlPlusa nd my doubt is How to send values to the variables in the WHERE clause.
Date: Tue, 13 Jan 2015 10:52:47 -0800 (PST)
Message-ID: <6a0319ca-eaf9-4ed0-8ffe-c95ba31e3841_at_googlegroups.com>
ALL Experts
I am testing the
As in the example below;
set echo on;
set head on;
spool /opt/oracle/xxxxyyyy.csv REPLACE
spool procedure in sqlplus
and my doubt is how to send values to the variables in the WHERE clause.
sqlplus -S /nolog <<EOF
CONNECT user/pwd_at_host:port/service_name;
set serveroutput on;
set termout off;
set pagesize 10000;
set linesize 10000;
select x, y, z
FROM r inner join d.d on r.id = d.id
inner join s on d.id = s.id
inner join dm on r.id = dm.id
WHERE
TO_CHAR(s.date,'DD/MM/YYYY') >= ('&StartDate')
AND
TO_CHAR(s.date,'DD/MM/YYYY') <= ('&EndDate')
spool off;
set echo on
EOF
exit
How could send linux sheel values for the variables (WHERE), &StartDate and &EndDate ?
Thanks for any help Received on Tue Jan 13 2015 - 19:52:47 CET