Tuesday, February 3, 2015

While Loop Sample in Jitterbit

<trans>
$BatchNo=DbExecute("<TAG>MFUND-CBRCP/Sources/kwaplive</TAG>",
"Select cbrb_batchid 
from cb_rcptbatch 
where cbrb_batchtot = 1 
and cbrb_batchid matches 'MF*'");
$No_of_Batch = Length($BatchNo);
$i=0;
while($i<$No_of_Batch,
$BatchTotal=DbExecute("<TAG>MFUND-CBRCP/Sources/kwaplive</TAG>",
"Select sum(cbrh_amount) 
from cb_rcpthdr 
where cbrh_batchid '"+trimchars($BatchNo[$i],"{}")+"'");
$SumAmount=trimchars($BatchTotal,"{}");
DbExecute("<TAG>MFUND-CBRCP/Targets/kwaplive</TAG>",
"update cb_rcptbatch  
set cbrb_batchtot = "+$SumAmount+", 
cbrb_usrctltot = "+$SumAmount+" 
where cbrb_batchid = '"+trimchars($BatchNo[$i],"{}")+"'");
$i=$i+1
)
</trans>

No comments:

Post a Comment