How mapping Table form ProDataSet to static Temp-table

Posted by Paweł Korczak on 23-May-2017 09:49

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

Posted by David Abdala on 24-May-2017 06:43

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.

This thread is closed