Take a look at the BUFFER-COPY statement - it copies fields per your definition from a source buffer into a target buffer. Still you need to code the logic to fetch the records into the source buffer and to create the target buffer:
Coded in notepad IDE, therefore not syntax checked:
FOR EACH SourceBuffer NO-LOCK WHERE ...:
CREATE TargetBuffer.
BUFFER-COPY SourceBuffer TO TargetBuffer.
do table-1 and table-2 have same field's? Are you always adding records to table-2 or will you also update existing table-2 records?
simple approach whould be to
loop through your first table in for each ..
a . with a WHERE (to filter records ) ..
b. OR inside the for each.... write code to filter your data
then use BUFFER-COPY to copy from table-1 to table-2.
you can also dump table-1 records to a file. Import data from file to temp-table. Do all validation/filter on temp-table... then copy from temp-table to table-2.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.