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

UPDATE SQL table - most better?

Former Member
0 Likes
451

Hi

I have internal table with many records, about thousands and I want to all this

record insert to database.

What is better:

UPDATE ztable from itab

or

insert every row to database in process of LOOP

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
413

Hi,

Use Modify


modify <your table> from table <your internal table>.

Note: please donot forget give commit work

2 REPLIES 2
Read only

Former Member
0 Likes
413

The answer is:

It depends.

In general, it's best to update from the internal table (faster); however, if you have a large number of records, you may dump if the rollback area is filled. You can get around this by updating in chunks.

But it also depends on what you think a logical unit of work is. It will depend on whether or not the whole process should fail if any records fail to insert.

Rob

Read only

former_member194669
Active Contributor
0 Likes
414

Hi,

Use Modify


modify <your table> from table <your internal table>.

Note: please donot forget give commit work