While: System.Last_Record

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Post Reply
User avatar
bessa_lucas
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 55
Joined: Fri, 17 Oct 2014 3:02 pm
Lucas Bessa
Analista de Sistemas

lucas.bessa@obers.com.br
lucas.bessa.ti@gmail.com

Gentlemen,

I have a very beginner doubt here, but in my company in almost all "whiles" are done so

Select all

while :system.last_record   != 'TRUE' loop 
 
SOME CODE  
 
end loop 
 
MORE CODE
The staff here uses :system.last_record to scroll through a list, but the last line is not executed. So we have to put the same loop code outside to run one more time.
Question:
Would it have any more practical form for him to perform everything within the loop?
User avatar
tiago_pimenta
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 213
Joined: Wed, 29 Jun 2011 9:49 am
Location: Barretos / SP

You could put it like this if I'm not mistaken:

Select all

loop 
<código> 
exit when :system.last_record = 'TRUE'; 
end loop;
User avatar
bessa_lucas
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 55
Joined: Fri, 17 Oct 2014 3:02 pm
Lucas Bessa
Analista de Sistemas

lucas.bessa@obers.com.br
lucas.bessa.ti@gmail.com

tiago_pimenta then I'll test and let you know if it worked!
Thanks!
User avatar
tiago_pimenta
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 213
Joined: Wed, 29 Jun 2011 9:49 am
Location: Barretos / SP

Bessa,

Only a correction, I forgot the NEXT_RECORD

So it would be like this:

Select all

loop 
<código> 
exit when :system.last_record = 'TRUE'; 
next_record; 
end loop;
User avatar
bessa_lucas
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 55
Joined: Fri, 17 Oct 2014 3:02 pm
Lucas Bessa
Analista de Sistemas

lucas.bessa@obers.com.br
lucas.bessa.ti@gmail.com

tiago_pimenta

Perfect! Tested and approved!
User avatar
tiago_pimenta
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 213
Joined: Wed, 29 Jun 2011 9:49 am
Location: Barretos / SP

Show:
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests