Title: Message
Checking for the existence of a particular record in a database before performing an UPDATE/DELETE on it is just good programming practice. An UPDATE/DELETE by definition, and in comparison to an INSERT, assumes that the record already exists.
 
Think of it this way... If someone asked you to take their car over to the car wash for them, but they didn't actually own a car; how likely is it that you would be able to get their car washed?

Matthew
 
 
----- Original Message -----
From: Joel Gwynn
Sent: Wednesday, March 27, 2002 12:27 PM
Subject: [Boston.pm] DBI weirdness

This is something bothersome that just started happening, or I just began noticing.  If I try to update or delete a record, like so:
"update addresses set first_name='Joel' where user_id=1", and there is no record matching user_id=1, my script hangs.  If the record exists, everything is fine.
 
I've been working around this by checking for the existence of a record before deletion/updating, but it doesn't seem right that I should need to do this.  What could be the problem?
 
I'm using DBI 1.14 on WindowsNT with SQL Server.

Reply via email to