Home » Developer & Programmer » Forms » for .. in .. clause (Forms 9.04/10.12)
for .. in .. clause [message #361004] Mon, 24 November 2008 11:37 Go to next message
since
Messages: 18
Registered: May 2008
Junior Member
That's a quite beginer question.

Usually, I use first_record , and then a loop...while ...end loop clause to fetch the value of all the records. Can I use a for... in <datablock> clause to do that?

Thanx!
Re: for .. in .. clause [message #361007 is a reply to message #361004] Mon, 24 November 2008 12:31 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I can tell, no, you can't do that.

Although it is used in Forms, it is still a PL/SQL FOR loop which has to follow certain rules.

Read more about Oracle loop statements.
Re: for .. in .. clause [message #361051 is a reply to message #361004] Mon, 24 November 2008 23:37 Go to previous messageGo to next message
raja.or.king
Messages: 24
Registered: November 2008
Location: GJ 5
Junior Member
I think you can use cursor FOR loop as follows

FOR indx IN (select...)
LOOP
...
END LOOP

this may solve your problem.
Smile
Re: for .. in .. clause [message #361080 is a reply to message #361051] Tue, 25 November 2008 00:27 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
raja.or.king
I think you can use cursor FOR loop as follows

FOR indx IN (select...)
LOOP

OK; what would you put instead of (select...) so that it complies Since's idea of having a
since
for... in <datablock>

Re: for .. in .. clause [message #361081 is a reply to message #361004] Tue, 25 November 2008 00:29 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
May I suggest that you let Oracle FOrms get the records for you.

David
Re: for .. in .. clause [message #361229 is a reply to message #361004] Tue, 25 November 2008 07:54 Go to previous messageGo to next message
since
Messages: 18
Registered: May 2008
Junior Member
I see,
That means I can only use loops without for..in.. like following..

loop
...
exit when :system.last_record = 'TRUE';
...
end loop;

Thank you!
Re: for .. in .. clause [message #361336 is a reply to message #361229] Wed, 26 November 2008 00:15 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
No. Base the block on a table and let Forms populate it for you.

David
Previous Topic: Problem when installing Forms10g R2
Next Topic: Global Variable
Goto Forum:
  


Current Time: Wed Dec 07 22:25:14 CST 2016

Total time taken to generate the page: 0.09865 seconds