plsql block in shell script
Hi,
I need to write a shell script like below
please help me completing this script ,
not allowed to write procedure as it will be a db object.
not sure about the construction and the approach of the programme
===================================================
$ORACLE_HOME/bin/sqlplus user/passwd <<EOF
declare
v_status varchar2(30)
v_sttm date;
v_endtm date
v_dur varchar2(30)
begin
select status into v_status from batch_info where id = 1234 ;
if v_status = 'COMPLETE'
select starttime, endtime , duration
into sttm, endtm, dur
from batch_info where id = 1234 ;
dbms_output.put_line (||sttm||' '||endtm||' '||duration);
else
dbms_output.put_line (||v_status);