Skip to Content
author's profile photo Former Member
Former Member

UPDATE SQL table - most better?

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 04, 2007 at 06:37 PM

    Hi,

    Use Modify

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

    Note: please donot forget give commit work

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 06:35 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.