Buffer-copy

Hi All,

I have a dynamic temp table with lots of fields, a dynamic query with the field list option. If I want to fill the temp table I can use the buffer-copy statement and use the exception-list. But if I want to assign just three fields (art-code, art-oms from the first buffer and mrk-oms from the second buffer) the exception list gets really long. Is there another way to fill the temp table without the use of buffer-copy?

Example
ASSIGN v-str_que = "FOR EACH art FIELDS ( art.art-code art.art-oms ) , FIRST mrk FIELDS ( mrk.mrk-oms ) OF art NO-LOCK MAX-ROWS 100 INDEXED-REPOSITION".

v-hdl_que:QUERY-OPEN.
v-hdl_que:QUERY-PREPARE(v-str_que).

REPEAT WHILE v-hdl_que:GET-NEXT(NO-LOCK):
v-hdl_tmp_tbl:BUFFER-CREATE.
v-hdl_tmp_tbl:BUFFER-COPY(v-hdl_buf[1],"xxx,xxx,...,zzz,zzz").
v-hdl_tmp_tbl:BUFFER-COPY(v-hdl_buf[2],"xxx,xxx,...,zzz,zzz").
END.


Any help appreciated.
 
You can use the BUFFER-FIELD() method to get the handles of the individual fields that you want to assign.

v-hdl_tmp_tbl_fld = v-hdl_tmp_tbl:BUFFER-FIELD('<field-name>').

v-hdl_buf_fld = v-hdl_buf[1]:BUFFER-FIELD('<field-name>').

and then just assign one to the other:

v-hdl_tmp_tbl_fld:BUFFER-VALUE = v-hdl_buf_fld:BUFFER-VALUE.
 
Top