FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » Database discussions » Determining when to use INSERT or UPDATE
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Determining when to use INSERT or UPDATE [message #20668] Mon, 25 October 2004 02:50 Go to previous message
Abraxa is currently offline  Abraxa   Germany
Messages: 72
Registered: August 2004
Location: Germany
Karma:
Member
Heya Smile

My problem is that have a table where I add new entries as well as modify existing ones - but what's the smartest way to determine when to use UPDATE or INSERT?

If I use UPDATE for a row id that doesn't exist, the update fails and if I use INSERT the entry I wanted to modify is still around.
That's why I thought about first deleting the row and then inserting it again but that wouldn't be a nice way imo.

Any ideas?

-Soeren
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Zero values in fields
Next Topic: MySQL 4.1 released
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 00:26:44 GMT 2024

Total time taken to generate the page: 0.04439 seconds