Cursor Problem [message #152562] |
Fri, 23 December 2005 23:35 |
samit_gandhi
Messages: 226 Registered: July 2005 Location: Hong Kong
|
Senior Member |
|
|
Dear Sir,
I have one detail block. I fetch the record from diffrent table by the cursor. But when i fetch the record the first record is overwritten by sencond record. i.e. first record is not shown in the block.
i have written the cursor like this :
DECLARE
DEPCNT NUMBER;
CURSOR C1 IS SELECT DESIGN_NO, COUNTER, STONE_CODE, USED_CARAT, USED_DIAMOND,SIZE_OF
FROM DIAMOND_RETURN_DETAIL
WHERE DESIGN_NO=:COST_SHEET.DESIGN_NO and COUNTER=:COST_SHEET.COUNTER;
BEGIN
SELECT COUNT(*)
INTO DEPCNT FROM DIAMOND_RETURN_DETAIL WHERE DESIGN_NO=:COST_SHEET.DESIGN_NO and COUNTER=:COST_SHEET.COUNTER;
IF DEPCNT > 0 then
OPEN C1;
FIRST_RECORD;
LOOP
FETCH C1 into :COST_SHEET.DESIGN_NO,
:COST_SHEET.COUNTER,
:COST_SHEET_DETAIL.STONE_CODE,
:COST_SHEET_DETAIL.USED_CARAT,
:COST_SHEET_DETAIL.USED_DIAMOND,
:COST_SHEET_DETAIL.SIZE_OF;
NEXT_RECORD;
GO_BLOCK('COST_SHEET_DETAIL');
GO_ITEM('COST_SHEET_DETAIL.USED_CARAT');
EXIT WHEN C1%NOTFOUND;
END LOOP;
CLOSE C1;
END IF;
END;
Please reply immediately as it is urgent.
Samit Gandhi
[Updated on: Mon, 26 December 2005 20:42] by Moderator Report message to a moderator
|
|
|
|