|Subject||Cursor not Executing Properly|
I have created the below cursor on Firbird DB (version 2.5). The update statement in below cursor is not updating value.
declare contractno CHAR(20);
declare cur_list_of_contracts cursor for (Select CU.CONTRACTNO From CLASSIC_UPGRADE CU, CONTRACT C where C.CONTRACTNO = CU.CONTRACTNO AND C.CONTRACTSTATUS = 'A' AND CU.INSERTDATE > '09/01/2016' AND CU.INSERTDATE < '09/10/2016' AND (CU.status = 'authorized' or CU.status = 'Authorized') AND C.CONVERT2YRDATE IS NULL );
while (ROW_COUNT > 0) do
fetch cur_list_of_contracts into contractno;
UPDATE CONTRACT C
SET CONVERT2YRDATE = (SELECT CU.INSERTDATE From CLASSIC_UPGRADE CU where CU.CONTRACTNO = :contractno)
where C.CONTRACTNO = :contractno;
if (ROW_COUNT = 0) then leave;
The block is getting executed without any errors.
But, the output is not as expected. The records in the table are not getting updated.
With Best Regards.