Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467

    Unanswered: Forms: copying 1 multi-record block to another

    Setup: Forms 9i, 9iDB (9.2.04.0), W2K

    I am trying to copy the data from one multi-record block to another.

    I have tried using the "copy from" property but that only brings over the record (and only the first one) when I actually click in the destination record.

    I tried using a for loop to cycle through the records and assign with block.item(i) := otherblock.item(i) notion and block.item(i) := otherblock.item(i) but neither of them got past the compile phase.

    I am thinking I might need to try forms_ddl() but I am hoping you fine Ladies and Gents are just waiting to give me a hand up.
    NOTE: Please disregard the label "Senior Member".

  2. #2
    Join Date
    Feb 2004
    Posts
    108
    How about keep dumping the first block data into a temp. pl/sql table ... and populating the second block with this whole chunk of data.
    This does involves lot of tracking.
    Or you can make the "second" block based on procedure or a Select statement. Populate the second block as "select everything from whatever_the_first_block_is_fetching_from"

    forms_ddl ? in what way you are thinking to use forms_ddl ?

  3. #3
    Join Date
    Feb 2004
    Posts
    108
    I guess second block based on select/procedure won't catch un-commited changes in first block. Bad idea.

  4. #4
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    un-commited changes is not an issue. As soon as I submitted my thread I thought of another way. Short on time so I will go try and report back.
    NOTE: Please disregard the label "Senior Member".

  5. #5
    Join Date
    Jan 2004
    Location
    North Haven, CT
    Posts
    110
    Originally posted by Todd Barkus
    un-commited changes is not an issue. As soon as I submitted my thread I thought of another way. Short on time so I will go try and report back.
    There is one way something like:

    first_record;
    loop
    loop
    go_item('item1');
    copy(name_in(:system.cursor_item),replace(:system. cursor_item,'blk1','blk2'));
    next_item;
    exit when :system.cursor_item = 'last item';
    end loop;
    exit when :system.last_record = 'TRUE';
    next_record;
    end loop;

  6. #6
    Join Date
    Jan 2004
    Location
    North Haven, CT
    Posts
    110
    Missed something. Hope it will work

    first_record;
    loop
    v_rec := :system.cursor_record;
    go_block('blk2');
    go_record(v_rec);
    go_block('blk1');
    go_record(v_rec);
    loop
    go_item('item1'); copy(name_in(:system.cursor_item),replace(:system. cursor_item,'blk1','blk2'));
    next_item;
    exit when :system.cursor_item = 'last item';
    end loop;
    exit when :system.last_record = 'TRUE';
    next_record;
    end loop;

  7. #7
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    Basic problem I ran into was OE (over-engineering). I was trying to work too hard. My 2 blocks are based on the same tables so I ended up just assigning key values in the new block and then executing a query. That worked great until I realized it was wrong. I wasn't really querying the record I wanted, instead I was querying all the records. At the time I only had one record so low and behold I queried the correct one. :-) :-( At that point I realized I was still suffering from OE. The final solution was set_block_property('block', ONETIME_WHERE, 'query'). NOTE: For those of you who have followed my posts you will remember that I have mentioned not being the sharpest knife in the drawer. I am glad to report that at least I am consistent. :-)
    NOTE: Please disregard the label "Senior Member".

Posting Permissions

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