DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: While loop

  1. #1
    Join Date
    Jun 2001
    Posts
    56

    Angry

    Hi

    Is there any any example of WHILE LOOP in Forms or in Reports?
    Thanx.

  2. #2
    Join Date
    Feb 2001
    Location
    Master Control
    Posts
    86
    what are you trying to use the loop for? you can use loops in report triggers i imagine. i have never worked with forms so i don't know about them.

  3. #3
    Join Date
    May 2001
    Posts
    70
    Mahomad..

    you can you a block level trigger that fires for each row of data is being queried. post-query trigger on the block.

    Can you explain what your attempting to accomplish, so we might be able to help you better.



  4. #4
    Join Date
    Aug 2000
    Posts
    462
    Sure.

    For example, let's suppose that you wish to display two blocks: a master block and detail block. Upon some event such as the user clicking a button, you want to update all the child records related to the current master. You should never do this via an UPDATE statement. Instead, create a loop and step through each record IN THE FORM which is to be updated:

    go_block('DETAILBLOCK');
    first_record;
    loop
    ---:detailblock.myfield := somenewvalue;
    ---exit when :SYSTEM.LAST_RECORD = 'TRUE';
    ---next_record;
    end loop;
    Oracle DBA and Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width