12-04-2007 11:53 AM
Hi,
What is the difference between Update and Modify in SQL?
Thanks in advance...
12-04-2007 11:54 AM
Hi,
Update statement only updates the existing record but Modify statement checks if the record exists in the DB. If so, it updates the record else it creates a new record.
Reward if clear...
Thank you.
12-04-2007 11:54 AM
Hi,
Update statement only updates the existing record but Modify statement checks if the record exists in the DB. If so, it updates the record else it creates a new record.
Reward if clear...
Thank you.
12-04-2007 11:56 AM
Hi
. Update will only update.
2. Its better to use MODIFY statement.
Based upon the primary key found/not found
in database table,
it will automatially Update / INSERT
the record.
3. We can do like this.
Loop at ITAB.
Modify DatabaseTable From Itab.
ENDLOOP.
MODIFY TO INSERT LINES INTO DATABSE TABLE REGARDLESS OF WHETHER THE PRIMARY KEY OF THIS LINE IS ALREADY EXISTS, USE MODIFY STATEMENTS.
IF THE DATABASE TABLE CONTAINS NO LINE WITH SAME PRIMARY KEY AS THE LINE TO BE INSERTED, MODIFY words LIKE INSERT IS USED.
IF THE DATABASE TABLE ALREADY CONTAINS LINE WITH SAME PRIMARY KEY AS THE LINE TO BE INSERTED,MODIFY words LIKE UPDATE ie THE LINE IS CHANGED
FOR MORE DOCUMENTATION GO THROUGH
12-04-2007 11:57 AM
the modify is a combination of update and insert. First it tries to update, if there is no record then it does an insert instead of update.
Performancewise, the modify is not arrayprocessing enabled. If you are sure, that an update is sufficient, then do not use modify.
Siegfried
12-04-2007 12:00 PM
Hi
<b>Update</b>
It will update all the records with same name in the particular field of the table. other wise it creates a new record
<b>Modify</b>
If record is available it modifies otherwise it wont modify.
Regards
Pavan