loop not working properly [message #478661] |
Mon, 11 October 2010 10:05 |
simcky
Messages: 38 Registered: July 2009
|
Member |
|
|
Hi guys
here i m giving the code
DECLARE
TYPE SUBNO_TABLE_TYPE IS TABLE OF
TRANS_DEICMAIN1.SUBNO%TYPE
INDEX BY BINARY_INTEGER;
SUBNO_TABLE SUBNO_TABLE_TYPE;
K NUMBER := 1;
S NUMBER := 1;
BEGIN
GO_BLOCK('BLOCK7');
FIRST_RECORD;
LOOP
IF :BLOCK7.CHECK1 = 'Y'
THEN
SUBNO_TABLE(K) := :BLOCK7.SUBNO;
END LOOP;
K := K+1;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;
END LOOP;
FIRST_RECORD;
K := 1;
GO_BLOCK('BLOCK2');
FIRST_RECORD;
LOOP
IF
:BLOCK2.SUBNO = SUBNO_TABLE(K)
THEN
K := K+1;
INSERT INTO BLOCK2 VALUES(:BLOCK2.SUBNO,:BLOCK2.NAME);
END IF;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;
END LOOP;
END;
HERE CHECK1 IS A CHECKBOX.
WHEN I AM USING THIS CODE ONLY ONE RECORD IS SAVED AT A TIME INSTEAD OF SAVING ALL RECORDS.COULD SOMEONE please HELP ME TO REMOVE THE BUG
|
|
|
|
|