Home » Developer & Programmer » Forms » Cursor Problem
Cursor Problem [message #152562] Fri, 23 December 2005 23:35 Go to next message
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

Re: Cursor Problem [message #152738 is a reply to message #152562] Mon, 26 December 2005 21:25 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Remove the go_block and see what happens.

David
Previous Topic: rotate and saves the rotated image
Next Topic: backing and restore a particular record
Goto Forum:
  


Current Time: Fri Sep 20 07:21:45 CDT 2024