Kbase P40200: Sample code that transfer the selected rows within a multipl
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  9/2/2003 |
|
Status: Unverified
GOAL:
Sample code that transfer the selected rows within a multiple browse to another browse.
FIX:
Let assume that:
- You're connected to the sports DB.
- TempCustomer is the name of a temp table that you have defined LIKE the customer table.
- Browse-1 is the source (multiple) browse created against sports.customer table.
- Browse-2 is the target browse created against the TempCustomer temp table.
This code will transfer all the selected rows of Browse-1 to Browse-2:
DO WITH FRAME DEFAULT-FRAME:
/*emptying tempTable */
FOR EACH TempCustomer.
IF AVAIL TempCustomer THEN
DELETE TempCustomer.
END.
/*copying the selected rows*/
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DO i = 1 TO browse-1:NUM-SELECTED-ROWS:
browse-1:FETCH-SELECTED-ROW (i).
CREATE TempCustomer.
BUFFER-COPY customer TO TempCustomer.
END.
/*refresh browse 2*/
OPEN QUERY browse-2 FOR EACH TempCustomer.
browse-2:REFRESH().
browse-2:DESELECT-ROWS().
END.