Home » Developer & Programmer » Forms » Simple Loop does not populate the block correctly (Ora Forms 10)
Simple Loop does not populate the block correctly [message #399720] Thu, 23 April 2009 12:23 Go to next message
toku
Messages: 1
Registered: April 2009
Junior Member
Hello,

this Statement in a procedure should populate a block of rows and coloumns.

for rec in
(select knf_kuerzel as system,
testfall_nr as tfnr,
test_dat as td,
ergebnis_kz as te,
test_wer as tw,
testfall_wer as tfw,
test_protokoll as tp
from sco_test_faelle
order by testfall_nr
)
loop

create_record;
-- record in block schreiben
:bl_testfaelle.tf_knf_kuerzel := rec.system;
:bl_testfaelle.tf_testfall_nr := rec.tfnr;
:bl_testfaelle.tf_testdatum := rec.td;
:bl_testfaelle.tf_ergebnis_kz := rec.te;
:bl_testfaelle.tf_test_wer := rec.tw;
:bl_testfaelle.tf_testfall_wer := rec.tfw;
:bl_testfaelle.tf_testprotokoll := rec.tp;

end loop;

The statement fetches all data correctly but Forms inserts the
selected rows all in the first row of the block.

Create_record does not work correctly.
Why?


It's the first time I'm programming with Forms 10.
In 1999 I coded the last Forms program on Forms 4.5, so
I'm not really a Forms - specialist Wink

Hoping someone can help, thanks for all

toku
Re: Simple Loop does not populate the block correctly [message #399732 is a reply to message #399720] Thu, 23 April 2009 15:11 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Such a question has already been asked (and answered). Perhaps you should pay attention to suggestions provided in the OraFAQ Forum Guide; it will - among others - tell you to use our Search engine. Doing so, you'd probably find the answer (or at least guidelines) to your question, much sooner than waiting for a message like this one (mine).

As of your problem: you are looping through certain records, put values into block items, but never move to the NEXT_RECORD.
Re: Simple Loop does not populate the block correctly [message #401437 is a reply to message #399720] Tue, 05 May 2009 01:00 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Populate block using cursor
http://www.orafaq.com/forum/m/605/67467/?srch=populate+block+cursor+create_record#msg_605
and my feelings about it.
http://www.orafaq.com/forum/m/134237/67467/?srch=populate+block+cursor+create_record#msg_134237
Another one of my rants.
http://www.orafaq.com/forum/mv/msg/74947/213213/67467/#msg_213213

David
Previous Topic: How to delete some last record on a non-database block(tabular)
Next Topic: Alternative for varchar2?
Goto Forum:
  


Current Time: Sat Dec 10 01:29:23 CST 2016

Total time taken to generate the page: 0.07876 seconds