Home » Developer & Programmer » Forms » PRBLEM IN SIMPLE LOOP (FORMS 6I)
PRBLEM IN SIMPLE LOOP [message #339949] Sun, 10 August 2008 03:53 Go to next message
sajidrazmi
Messages: 47
Registered: August 2008
Location: oman
Member
HI ALL
I AM GETTING ONE PROBLEM
I HAVE TWO BLOCK IN ONE BLOCK I GOT ALL THE DATA NOW I WANT TO DIPLAY SOME RECORDS IN SECOND BLOCK I HAVE WRITTEN THIS CODE
BEGIN
GO_BLOCK('BLK_TAS_TEMP');
FIRST_RECORD;
LOOP
IF :BLK_TAS_TEMP.TAS_TEMP_STATUS ='A' THEN
GO_BLOCK('ASG_TAS_ABS');
CLEAR_BLOCK(NO_VALIDATE);

:ASG_TAS_ABS.TAS_ABS_EMP_CODE:=:BLK_TAS_TEMP.TAS_TEMP_EMP_CODE;
:ASG_TAS_ABS.TAS_ABS_EMP_NAME:=:BLK_TAS_TEMP.TAS_TEMP_EMP_NAME;
:ASG_TAS_ABS.TAS_ABS_STATUS :='A';
NEXT_RECORD;
END IF;
GO_BLOCK('BLK_TAS_TEMP');
EXIT WHEN:SYSTEM.LAST_RECORD ='TRUE';
NEXT_RECORD;
END LOOP;
FIRST_RECORD;
END;

BUT IN THIS BLOCK I AM GETTING ONLY LAST ROW DATA
PLEASE HELP ME OUT OF THIS PROBLEM
THANKS
Re: PRBLEM IN SIMPLE LOOP [message #339950 is a reply to message #339949] Sun, 10 August 2008 05:20 Go to previous messageGo to next message
sajidrazmi
Messages: 47
Registered: August 2008
Location: oman
Member
STILL I AM NOT GETTING ANY RESPONSE FROM ORACLE GURU PLEASE GIVE ME RESPONSE
I HAVE WRITTEN THIS CODE TO
POST-QUERY TRIGGER
PLESE HELP ME I AM IN NEED

[Updated on: Sun, 10 August 2008 05:21]

Report message to a moderator

Re: PRBLEM IN SIMPLE LOOP [message #339980 is a reply to message #339950] Sun, 10 August 2008 13:08 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

I think your code is wrong even according to your logic.

If I'm not wrong, you want to populate the second block if a row in the first block matches the criteria

i.e: IF :Block1.item ='A' THEN
Populate the row into second block.
ELSE do not populate the row in second block.

Your code should look like this

begin
	loop
		if :Block1.col = 'A' then
		go_block('Block2');
		next_record;
		:Block2.col1 := :Block1.col1;
		:Block2.col2 := :Block1.col2;
		:Block2.col3 := :Block1.col3;
		go_block('Block1');
		else
			null;
		end if;
	next_record;
	exit when :system.last_record = 'true';
	end loop;
end;

I hope this will help.
regards,
Saadat Ahmad
Re: PRBLEM IN SIMPLE LOOP [message #340005 is a reply to message #339980] Sun, 10 August 2008 23:40 Go to previous message
sajidrazmi
Messages: 47
Registered: August 2008
Location: oman
Member
hi dear thanks for giving me response i have solve my problem
i have written these codes now it is working properly
GO_BLOCK('BLK_TAS_TEMP');
FIRST_RECORD;
LOOP
GO_BLOCK('ASG_TAS_ABS');
IF :BLK_TAS_TEMP.TAS_TEMP_STATUS ='A' THEN
GO_BLOCK('ASG_TAS_ABS');
:ASG_TAS_ABS.TAS_ABS_EMP_CODE:=:BLK_TAS_TEMP.TAS_TEMP_EMP_CODE;
:ASG_TAS_ABS.TAS_ABS_EMP_NAME:=:BLK_TAS_TEMP.TAS_TEMP_EMP_NAME;
:ASG_TAS_ABS.TAS_ABS_STATUS :='A';
next_record;
end if;
GO_BLOCK('BLK_TAS_TEMP');
EXIT WHEN :SYSTEM.LAST_RECORD ='TRUE';
NEXT_RECORD;
END LOOP;
Previous Topic: how to inherit list item
Next Topic: to relate 2
Goto Forum:
  


Current Time: Sun Feb 09 23:59:44 CST 2025