Re: Forms 3.0 Selecting multiple records into a block? Not Querying...

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/05/13
Message-ID: <5la271$231_at_info.csufresno.edu>#1/1


If I understand your question, you have a base-table block but you want to populate the block from rows from another table which is not the base-table. The easy part of this is the select. It should be a cursor, not a select: Declare cursor C is select col1 from tbl1 where...; Then you need a loop to fetch all the rows:   Open C; Loop Fetch C into :Blk.col1; Exit when C%Notfound;

     --Now here's the part you missed--
    Next_Record;
  End loop; First_Record; Close C;

The only problem with the above is that now, all rows you have fetched will be automatically inserted into the base table when the user commits, regardless of whether the user entered any changes.

It might be easier to assign the blocks to the original tables, and in an on-update trigger, prevent the original table from being updated, and instead write your own insert to the 'changes' table.

HTH,
Steve Cosner



Try out QA, a dynamic data utility form. Quick display and update access to any table. http://members.aol.com/stevec5088

In article <5l9rdm$g6_at_news.rl.af.mil>, Mark S Reichman <reichmanm_at_rl.af.mil> wrote:
>Otay...
>
> Yes we still use forms 3.0 and do not use froms 4.5. We are however
>converting to Designer/Developer 2000 progs soon. So... That aside..
>My question..
>
>I need to select multiple records into a block. Up to this point I have
>never had to do this. I do not want to query the records because I do not
>want to destroy queried records with user commited updates.
>I plan to select records into 3 multiple record blocks from three tables then
>insert the selected/user updated records into another 3 identical tables. This
>is to preserve the original tables data for future use. Since a
>TOO_MANY_ROWS exception will occur in the select statement when multiple
>records are returned, placing "null;" in the exception handler for
>TOO_MANY_ROWS will only allow the display of the first record selected by the
>select statement. I need all the records selected to show up in the block.
>Formatting the form to display multiple records is not a problem, making
>the a select statement return more that one record into a multi record
>block is the entire problem.
>
>Any suggestion? If this is possible you may use the word "Idiot" in your
>reply.(Hehe) Thanks Mark...
>
>
Received on Tue May 13 1997 - 00:00:00 CEST

Original text of this message