Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

about insert statement .

Former Member
0 Likes
626

Hi,

i need to insert 10,00,000 records into one table from one another table.

i have used insert statement like

insert <Database table> from <internal table>.

I want to know it will insert this much record or is there any chance of dump

because of the size of the record.

thanks,

jack

5 REPLIES 5
Read only

Former Member
0 Likes
589

hi,

u might get dump error for time out. as it takes lot of time...

try to insert in different number of amount.. not as in 1 time.

Regards

SAB

Read only

Former Member
0 Likes
589

Thanks for reply.

How can i divide my internal table .?

thanks,

Jack

Read only

0 Likes
589

10,000.00 does not matter, you can insert as many depends on ur database buffer.

If you use insert command and you may get dump because if you are trying to insert existing record.

so better to use modify command.I will recommend try to run the program in background.

modify dbtable from table int_table.

Thanks

Sesh

Message was edited by:

Seshu Maramreddy

Read only

0 Likes
589

If you are able to get 1 million records into an internal table without getting a runtime error, then inserting them into the DB table should not be a problem. If you are getting runtime error getting 1 million records into your internal table, you should think about running it in the background. You may also encounter issue with the maximum setting your basis team did for internal table memory.

Try it and you will know.

Read only

Former Member
0 Likes
589

Hi,

This may give a dump due to lack of memory owing to huge number of records.

I would suggest you to fetch data from the table in chunks.

Create a loop until there are any more records in the table.

Use UP TO .. ROWS while fetching data from the table into internal table. Then insert these records from internal table into database table.

Code will look like:

DO.

SELECT * INTO ITAB1

UPTO 40000 ROWS

FROM TAB1.

IF SY-SUBRC = 0.

INSERT TAB2 FROM ITAB1.

ELSE.

EXIT.

ENDIF.

ENDDO.

Hope this helps.