How mapping Table form ProDataSet to static Temp-table - Forum - OpenEdge Development - Progress Community

How mapping Table form ProDataSet to static Temp-table

 Forum

How mapping Table form ProDataSet to static Temp-table

This question is not answered

How map table form prodataset to static TEMP-TABLE ?

Paweł 

Exmple 

define temp-table tt_buf NO-UNDO like IKORmenu .
define temp-table tt_sys NO-UNDO like IKORsystem .

DEFINE INPUT PArameter DATASET-HANDLE ds .
/* ------------------------ */

TEMP-TABLE tt_buf:copy-temp-table ( ds:get-top-buffer(1) ).
TEMP-TABLE tt_sys:copy-temp-table ( ds:get-top-buffer(2) ).

All Replies
  • I'm not sure about what are you actually asking.

    If the question is actually about copying table structure: you can't change a static table structure.

    If the question is about copying table content:

    topBuff = ds:get-buffer(1).

    create query hquery.

    hquery:query-prepare('for each ' + topBuff:table-name).

    hquery:query-open().

    do while hquery:get-next():

     create tt_buf.

     buffer tt_buf:Handlef:BUFFER-COPY(topBuff,'<field mapping here>').

    end.

    Look the docs for buffer-copy, it has parameters and I never remembers if it receives source, or destination, buffer.