Hi,
I wrote a method for to perform a loop to update a table. Below is my method
public void insert()
{
CaeLoa _caeloa;
caeSecurityProj _caeSecurityProj;
caeSecurity _caeSecurity;
super();
while select caeloa from _caeloa join _caeSecurityProj where _caeloa.loa ==
_caeSecurityProj.Loa join _caeSecurity where _caeSecurity.SecurityNo == _caeSecurityProj.SecurityNo
&& this.SecurityNo == '100656808'
{
if ( _caeSecurity.EndDate == datenull())
{
_caeloa.Exhausted = _caeloa.Exhausted+1;
_caeloa.Available = _caeloa.Capacity - _caeloa.Exhausted ;
_caeloa.update();
}
else
If((_caeSecurity.EndDate > _caeloa.Valid) && (_caeSecurity.EndDate < _caeloa.Expiry))
{
_caeloa.Exhausted = _caeloa.Exhausted - 1;
_caeloa.Available = _caeloa.Capacity - _caeloa.Exhausted ;
_caeloa.update();
}
}
In the above method i haev 3 tables. caeSecurity , caeSecurityProj, caeLoa. I am writing a update method in the table of caeSecurity. Here it contains EndDate as field. Another table called caeSecurityProj where primary key is securityno in the above table.And in this table it has field called loa field. This is primary key and it joins with caeloa table with loa field. Now i need to consider the Enddate from the caeSecurity table and to be compared with the date of caeloa table Valid date and expiry date. If the caesecurity table enddate is in between the caeloa table valid and expiry field then i need to update caeloa table Exhausted field and available as above. Here the problem is when i compile the above method it runs with no errors.But when i put breakpoint then i can see caeloa table Valid and expiry is showing as 0 whereas loa field is showing with value..I did not understand why those field are empty.because 1 security number can have multiple loa's.So it has to loop all loa of 1 security no and check every line valid date and expiry date with the header end date .Please let me know if my question is unclear.
Thanks..