‎2009 Jan 22 7:26 PM
Hi,
I need to insert in a dbtab from other dbtab. I would like use a sql sentence like this:
insert into dbtab2 (c1,c2)
select c1,sum(c2)
from dbtab1
group by c1,c2.
How can I do it ?
(I can´t use internal tables because its size is very big (more than 2 Gb). If I use internal tables, the process "crash" with error SYSTEM_IMODE_TOO_LARGE)
Thanks
‎2009 Jan 22 7:52 PM
Hi Oscar Alconchel
Try the following code hope this will help you in this way, only assign the value to Work Area and then from this work area update the dbtable.
TYPES: BEGIN OF t_test,
c1(10) type c,
c2(10) type c,
END OF t_test.
Data: wa_test type t_test.
Select c1 sum(c2) as c2
INTO CORRESPONDING FIELDS OF wa_test.
modify dbtable from wa_test.
endselect.Kind Regards,
Faisal
‎2009 Jan 22 7:48 PM
Hi,
You can't do this in a single shot, at least with any known to me way. Anyhow you can do other thing: using se16n download your DB table partially to lets say 10 files. Now write a simple report uploading these files and inserting their rows to next DB table.
Of course I assume you only need to transfer these data somehow so this solution would help.
Regards
Marcin
‎2009 Jan 22 7:52 PM
Hi Oscar Alconchel
Try the following code hope this will help you in this way, only assign the value to Work Area and then from this work area update the dbtable.
TYPES: BEGIN OF t_test,
c1(10) type c,
c2(10) type c,
END OF t_test.
Data: wa_test type t_test.
Select c1 sum(c2) as c2
INTO CORRESPONDING FIELDS OF wa_test.
modify dbtable from wa_test.
endselect.Kind Regards,
Faisal
‎2009 Jan 22 7:58 PM
Hi Faisal,
This way is of course correct but Oscar said db table is extremly large. Imagine how this would affect performance (number of access to DB tables + network traffic) if it was moved row by row as you suggested.
Regards
Marcin