Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Best method: Update all fields or only those that have changed

Best method: Update all fields or only those that have changed

From: Rhugga <rhugga_at_yahoo.com>
Date: Mon, 02 Apr 2001 12:22:01 -0700
Message-ID: <8qjhcts61mtg2pqotj0f0kmdl4uno919lg@4ax.com>

I have some CGI stuff that interacts with various tables in Oracle,
(no joins or anything like that). One group of scripts is a contact
managment system I am developing and it uses a table with 44 columns. One part of this 'application' will allow the changes to be made which will be an UPDATE statement in the script.

What is the best method to do: Only update the fields that were changed, or update every field even if it does not change. The entire record will be displayed in an HTML form, there they can make changes and they will be UPDATE'd back to the database. This script will be relatively simple if I just UPDATE every column, but I wanted to see what impact this might have on the Oracle side.

I assume only updating the changed fields is the best moethod, but is there any harm in updating fields but not actually changing them?
(There were always be at least one column in the table getting updated
for real)

I do not necessarily care about generating any extra redo/archive log, if that is the case.

As a side note, would updating a field with not actually changing the value stored there generate redo?

Thankx,
CC Received on Mon Apr 02 2001 - 14:22:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US