Skip to Content
0

Copy data between two tables using cursor

Nov 18, 2016 at 10:54 AM

42

avatar image
Former Member

Hello,

I have two tables in SAP (DB2 database). Table 1 contains 100 fields. Table 2 contains all the fields from Table 1 except 10 fields.

I need to do a straight copy from Table 1 to Table 2 for corresponding fields. I need to copy around 1 billion records. What is the best way to do so. I don't need to read the data in ABAP layer.

Thanks in advance

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Raymond Giuseppi
Nov 18, 2016 at 01:02 PM
0

You should post also in a DB2 forum, for native SQL statements like

  INSERT INTO YOURLIB.TARGET
     (FIELD1, FIELD2, FIELD3, ... FIELD90)
  SELECT FIELD1, FIELD2, FIELD3, ... FIELD90
    FROM YOURLIB.SOURCE

(or create some view on the bigger table with fields of the smaller one to use in the SELECT part)

Else, in Abap, look in forum for samples of parallelization or cursor, calling for insert of batches of records in another task, there are already many samples.

Regards,
Raymond

Share
10 |10000 characters needed characters left characters exceeded