Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Looping(all blocks, all records, all items) multi and single record blocks) will this work?

1,013 views
Skip to first unread message

steve deno

unread,
Jun 5, 2003, 4:49:03 PM6/5/03
to
Hi all,

I am trying to loop through all records in all blocks and hit all
items, to check their values/properties. I have a procedure and it
ALMOST seems to work in the following code. However, I think that the
fact of where I am navigating at which time is causing an issue. the
result is that I hit all blocks andd items but not all records in
multi-record blocks. to start, I see in the debugger that
:SYSTEM.last_record has no value. Is this my problem? All help is
appreciated. Thanks very much

BEGIN
cur_frm := :SYSTEM.Current_Form;
cur_blk := Get_Form_Property(cur_frm,FIRST_BLOCK);
lst_blk := Get_Form_Property(cur_frm,LAST_BLOCK);
cur_itm := cur_blk||'.'||Get_Block_Property(cur_blk,FIRST_ITEM);
lst_itm := cur_blk||'.'||Get_Block_Property(cur_blk,LAST_ITEM);

WHILE cur_blk <> lst_blk LOOP--BLOCK--
First_Record;
WHILE :SYSTEM.last_record != 'TRUE'LOOP--RECORD--
WHILE cur_itm <> lst_itm LOOP--ITEM --
My code to be run on every item of every record of every block
in my form
cur_itm := cur_blk||'.'||GET_ITEM_PROPERTY(cur_itm, NEXTITEM);
END LOOP;--ITEM --
NEXT_RECORD;
END LOOP;--RECORD--
cur_blk := GET_BLOCK_PROPERTY(cur_blk, NEXTBLOCK);
cur_itm := cur_blk||'.'||Get_Block_Property(cur_blk,FIRST_ITEM);
lst_itm := cur_blk||'.'||Get_Block_Property(cur_blk,LAST_ITEM);
END LOOP;--BLOCK--

END;

Sybrand Bakker

unread,
Jun 5, 2003, 6:26:57 PM6/5/03
to
On 5 Jun 2003 13:49:03 -0700, sldc...@yahoo.com (steve deno) wrote:

> Is this my problem?


Your problem is you don't understand developer automatically loops
through all records of a multirecord block.


Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address

Maximus

unread,
Jun 6, 2003, 2:53:10 PM6/6/03
to

"steve deno" <sldc...@yahoo.com> wrote in message
news:8e6b14d8.03060...@posting.google.com...

> Hi all,
>
> I am trying to loop through all records in all blocks and hit all
> items, to check their values/properties. I have a procedure and it
> ALMOST seems to work in the following code. However, I think that the
> fact of where I am navigating at which time is causing an issue. the
> result is that I hit all blocks andd items but not all records in
> multi-record blocks. to start, I see in the debugger that
> :SYSTEM.last_record has no value. Is this my problem? All help is
> appreciated. Thanks very much
>
> BEGIN
> cur_frm := :SYSTEM.Current_Form;
> cur_blk := Get_Form_Property(cur_frm,FIRST_BLOCK);
> lst_blk := Get_Form_Property(cur_frm,LAST_BLOCK);
> cur_itm := cur_blk||'.'||Get_Block_Property(cur_blk,FIRST_ITEM);
> lst_itm := cur_blk||'.'||Get_Block_Property(cur_blk,LAST_ITEM);
>
> WHILE cur_blk <> lst_blk LOOP--BLOCK--

GO_BLOCK(cur_blk); << need to add this here

> First_Record;
> WHILE :SYSTEM.last_record != 'TRUE'LOOP--RECORD--
> WHILE cur_itm <> lst_itm LOOP--ITEM --
> My code to be run on every item of every record of every block
> in my form
> cur_itm := cur_blk||'.'||GET_ITEM_PROPERTY(cur_itm, NEXTITEM);
> END LOOP;--ITEM --
> NEXT_RECORD;
> END LOOP;--RECORD--
> cur_blk := GET_BLOCK_PROPERTY(cur_blk, NEXTBLOCK);
> cur_itm := cur_blk||'.'||Get_Block_Property(cur_blk,FIRST_ITEM);
> lst_itm := cur_blk||'.'||Get_Block_Property(cur_blk,LAST_ITEM);
> END LOOP;--BLOCK--
>
> END;

You need to use GO_BLOCK(cur_blk) before FIRST_RECORD to make it the active
block before you start looping through it's records.


0 new messages