Home » Developer & Programmer » Forms » loop in data block
loop in data block [message #227776] Thu, 29 March 2007 06:56 Go to next message
seddik_saber
Messages: 6
Registered: March 2007
Location: Tunisia
Junior Member
i search how to loop into a datablock for making a sum of a column?
please help me


PS:i'm a new user of oracle forms developping tool
Re: loop in data block [message #227821 is a reply to message #227776] Thu, 29 March 2007 09:08 Go to previous messageGo to next message
seddik_saber
Messages: 6
Registered: March 2007
Location: Tunisia
Junior Member
i have using this
	go_block('BLOK1');
	first_record;
	loop
		If :system.last_record = 'TRUE' then
			Exit;
		Else
			Next_record; 
		End If;
	end loop;


but the probleme is that is the controle before the execution loose the focus any solution
Re: loop in data block [message #227860 is a reply to message #227776] Thu, 29 March 2007 19:14 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Which version of Forms are you using? If you are using 6i or higher, consider using the 'calculation' properties of an item.

Have a look at http://www.orafaq.com/forum/m/222451/67467/?srch=calculation#msg_222451

David
Re: loop in data block [message #228338 is a reply to message #227776] Mon, 02 April 2007 10:48 Go to previous messageGo to next message
seddik_saber
Messages: 6
Registered: March 2007
Location: Tunisia
Junior Member
i'm using forms 6.0.
please explain more the calculation properties
Re: loop in data block [message #228339 is a reply to message #227776] Mon, 02 April 2007 10:58 Go to previous messageGo to next message
seddik_saber
Messages: 6
Registered: March 2007
Location: Tunisia
Junior Member
ok i have find how to use the calculation mode.
but if i have a more complicated function other a sum how you fix it.
thanks for all
Re: loop in data block [message #228417 is a reply to message #228339] Tue, 03 April 2007 00:01 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Consider using the Post-Query trigger but remember that it fires for each line retrieved, not the whole 'select' statement.

Alternatively, retrieve all the information via a select statement in the When-New-Form-Instance trigger and populate the non-database fields of a 'control' block that appear on the same canvas as the items from the database block on which the values are based.

If you place the logic in a Forms procedure then you can all it in the WNFI trigger or in other triggers or buttons that you may have for doing requeries.

David
Previous Topic: What software should i buy if want to develop a web site using Oracle Forms and Reports (Merged)
Next Topic: Difference
Goto Forum:
  


Current Time: Fri May 26 00:38:56 CDT 2017

Total time taken to generate the page: 0.16873 seconds