Optimized way

Posts   
 
    
GenXMapper
User
Posts: 2
Joined: 12-Dec-2006
# Posted on: 12-Dec-2006 17:14:09   

Hi ppl,

let me explain the scenario.

I have a record and require some modification to the record.. like modifying the employee phone no. Which of the following is the optimized way.

1. Deleting the record and re-entering the same record as a new record. 2. Updating the record with modified information.

waiting for the answers ... ?

anyway... thanks in advance... smile

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 12-Dec-2006 20:05:33   

How does this record relate to other records within your database? if this record is a parent to any other records (the 1 side of a 1:N relation), then you couldn't delete it unless no childern exist.

If it is only on the N side of 1:N then you could delete/re-insert. However it is much more effeceint to update the exsiting record.

I believe it would be difficult to come up with a solid reason for delete/re-insert given the example.

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 13-Dec-2006 02:22:56   

I agree with you jmeckley I can think of a lot of problems with delete and insert and no advantages.

GenXMapper
User
Posts: 2
Joined: 12-Dec-2006
# Posted on: 13-Dec-2006 11:47:39   

jmeckley wrote:

How does this record relate to other records within your database? if this record is a parent to any other records (the 1 side of a 1:N relation), then you couldn't delete it unless no childern exist.

If it is only on the N side of 1:N then you could delete/re-insert. However it is much more effeceint to update the exsiting record.

I believe it would be difficult to come up with a solid reason for delete/re-insert given the example.

jmeckley...... thanks for the reply.... I agree with you and believe update wud be the best way rather delete.... anyway..... thanks a bunch....

thanks bclubb !!! simple_smile