delete lines
DECLARE
CURSOR C1 IS
SELECT COUNT(*) TOT_COUNT
FROM sbis.bayadcenter b
where b.cust_code='CUST01';
CURSOR C IS
SELECT b.cisi,b.dep_date,b.branch,b.drn_no,b.chk_no,b.chk_amt,amt.tot_amt
FROM (select b.drn_no,sum(chk_amt) tot_amt
from sbis.bayadcenter b
where b.cust_code='CUST01'
and b.dep_date= :cgtemp.dep_date
group by b.drn_no) amt, sbis.bayadcenter b
where b.cust_code='CUST01'
and b.dep_date= :cgtemp.dep_date
and b.drn_no=amt.drn_no;