TariqMehmod
Programmer
Sir, I have following codes
[pre]select cr_sum
index on acc_code to myindex
set order to myindex
go top
scan
scatter memvar
lnamt = m.payable
mydate=date
mycode=m.acc_code
vouchersx="crs"+sys(2015)
select date,vou_no,acc_code,balance,vou_type;
from vouchers;
where acc_code=alltrim(m.acc_code) and date=>m.date;
order by date,vou_type,vou_no;
into cursor vouchersx readwrite
select vouchersx
scan for balance > 0 and acc_code=alltrim(m.acc_code) and date=>m.date
do case
case lnamt > nvl(vouchersx.balance,0)
lnamt = lnamt - nvl(vouchersx.balance,0)
replace cr_sum.paid with nvl(cr_sum.paid,0) +nvl(vouchersx.balance,0)
replace vouchers.balance with 0
replace cr_sum.pdate with vouchersx.date
case lnamt =< nvl(vouchersx.balance,0)
replace cr_sum.paid with nvl(cr_sum.paid,0) + nvl(vouchers.balance,0)
replace vouchersx.balance with nvl(vouchersx.balance,0) - lnamt
replace cr_sum.pdate with vouchersx.date
lnamt = 0
endcase
if lnamt = 0
exit
endif
endscan
endscan
[/pre]
Table cr_sum has 7000 records.
The above codes takes 20 Minutes to complete.
Is it possible to make codes more faster?
Please
[pre]select cr_sum
index on acc_code to myindex
set order to myindex
go top
scan
scatter memvar
lnamt = m.payable
mydate=date
mycode=m.acc_code
vouchersx="crs"+sys(2015)
select date,vou_no,acc_code,balance,vou_type;
from vouchers;
where acc_code=alltrim(m.acc_code) and date=>m.date;
order by date,vou_type,vou_no;
into cursor vouchersx readwrite
select vouchersx
scan for balance > 0 and acc_code=alltrim(m.acc_code) and date=>m.date
do case
case lnamt > nvl(vouchersx.balance,0)
lnamt = lnamt - nvl(vouchersx.balance,0)
replace cr_sum.paid with nvl(cr_sum.paid,0) +nvl(vouchersx.balance,0)
replace vouchers.balance with 0
replace cr_sum.pdate with vouchersx.date
case lnamt =< nvl(vouchersx.balance,0)
replace cr_sum.paid with nvl(cr_sum.paid,0) + nvl(vouchers.balance,0)
replace vouchersx.balance with nvl(vouchersx.balance,0) - lnamt
replace cr_sum.pdate with vouchersx.date
lnamt = 0
endcase
if lnamt = 0
exit
endif
endscan
endscan
[/pre]
Table cr_sum has 7000 records.
The above codes takes 20 Minutes to complete.
Is it possible to make codes more faster?
Please