<div dir="ltr">A point of order: it's not necessary to post three separate "this is the wrong list" replies. In fact the optimal number is probably close to zero -- I understand we all want to be helpful, and we don't want to send duplicate replies, but someone who posts an inappropriate question is likely to try another venue when they receive no replies, and three replies to the list implies that some folks are a little too eager to appear helpful (while reading the list with considerable delay). When the OP pings the thread maybe one person, preferably someone who reads the list directly via email from the list server, could post a standard "wrong list" response.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 15, 2016 at 8:29 AM, Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 15 June 2016 at 07:40, ninostephen mathew <<a href="mailto:ninosm12@gmail.com">ninosm12@gmail.com</a>> wrote:<br>
> Respected Developer(s),<br>
> while writing a database module for one of my applications in python I<br>
> encountered something interesting. I had a username and password field in my<br>
> table and only one entry which was  "Admin" and "password". While debugging<br>
> I purposefully deleted that record. Then I ran the same statement again. To<br>
> my surprise, it got execute. Then I ran the statement to delete the user<br>
> "admin" (lowercase 'a') which does not exist in the table. Surprisingly<br>
> again is got executed even though the table was empty. What I expected was<br>
> an error popping up. But nothing happened.  I hope this error gets fixed<br>
> soon. The code snippet is given below.<br>
><br>
> self.cursor.execute(''' DELETE FROM Users WHERE username =<br>
> ?''',(self.username,))<br>
<br>
</div></div>First of all, this list is for the discussions about the development<br>
of Python itself, not for developing applications with Python. You<br>
should probably be posting to python-list instead.<br>
<br>
Having said that, this is how SQL works - a DELETE statement selects<br>
all records matching the WHERE clause and deletes them. If the WHERE<br>
clause doesn't match anything, nothing gets deleted. So your code is<br>
working exactly as I would expect.<br>
<span class="HOEnZb"><font color="#888888"><br>
Paul<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>