List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:July 15 1999 8:28pm
Subject:Re: Unintentional DELETE FROM!
View as plain text  
Dan Ray wrote:
> 
> Evidently the statement "DELETE FROM table WHERE field = 00" was interpreted
> like "DELETE FROM table".
> 
> mysql> SELECT * FROM Auto_Reorders;
> +------------+------------+
> | Orderno    | Next_Date  |
> +------------+------------+
> | luro472701 | 1999-08-08 |
> | lmdg703601 | 1999-08-08 |
> | lmdg703602 | 1999-08-08 |
> | lmdg703604 | 1999-08-08 |
> | 00         | 1999-08-08 |
> | 00         | 1999-08-08 |
> | nary969401 | 1999-08-09 |
> | wxab709201 | 1999-08-09 |
> | jcvi105601 | 1999-08-10 |
> | atmj410501 | 1999-08-11 |
> | ktsh745201 | 1999-08-23 |
> | nods789401 | 1999-08-25 |
> | jazy450901 | 1999-08-27 |
> | yzun341201 | 1999-09-14 |
> | lwvk101001 | 1999-09-01 |
> | qrgz923001 | 1999-09-08 |
> +------------+------------+
> 16 rows in set (0.00 sec)
> 
> mysql> DELETE FROM Auto_Reorders WHERE Orderno = 00;
> Query OK, 16 rows affected (0.00 sec)
> 
> Yikes! Talk about unintended consequences! I just wanted to knock out the
> bad ones from early testing of the program.
> 
> mysqladmin version yields:  Server version  3.21.33b
> 
> Any thoughts about this?
> 
> Dan Ray
> Account Manager
> Senior Web Developer
> Triangle Research, Inc.
> http://www.triangleresearch.com
> 
>

When specify they value of a CHAR column, make sure put it in quotes =
'00'

-- 
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)
Thread
Unintentional DELETE FROM!Dan Ray16 Jul
  • Re: Unintentional DELETE FROM!Steve Ruby16 Jul
  • Re: Unintentional DELETE FROM!Sasha Pachev16 Jul
    • RE: Unintentional DELETE FROM!Dan Ray16 Jul
      • RE: Unintentional DELETE FROM!Paul DuBois16 Jul
        • RE: Unintentional DELETE FROM!Dan Ray16 Jul