Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #34646

MySQLdb compare lower

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <tolidtm@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.056
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'received:209.85.223': 0.03; 'cursor': 0.09; 'def': 0.10; 'guys,': 0.16; 'lowercase': 0.16; 'subject:compare': 0.16; 'message-id:@mail.gmail.com': 0.27; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'compare': 0.36; 'skip:m 40': 0.36; 'received:209': 0.37; 'some': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'situation': 0.62; 'solve': 0.62
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=/KMPrmEqGk58jx4e0Y0uCAiuAzptQDoWmoIeKtGL520=; b=K7MY/bmVwyzitldYabygsV0beig1EAvXqEFXotLE4LKzkBudgmwxo5E8ei4Pg4znb5 3xbwi/0OqmdIrptnmmzG+eiDnDQ7ThWTIRZGFiyXI0RWJ3nmXhlAj78rS/pbuBiElts7 5t++fewT5PaV8Y9R7+ipsyl92m2T2TGbehhN+GKHIoFoPGAlx1+oFfTYmrOpZqeZ30Zt oHHRHJwGqUXcAlWV9DShC/w1lBRSc9/Dk7RMX9rfb2dP2LrhQkYN3Sn/hx1/x4rlOWnj Iqo8DQ6Hwb4ZYhx1KVfCGZdhau4iBKhbFGNEz5nR7GNuYwZi9ai+osi7vyyayUg3qmXx VhvQ==
MIME-Version 1.0
Date Tue, 11 Dec 2012 22:01:18 +0100
Subject MySQLdb compare lower
From Anatoli Hristov <tolidtm@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.742.1355259688.29569.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355259688 news.xs4all.nl 6876 [2001:888:2000:d::a6]:42416
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:34646

Show key headers only | View raw


Hello guys,

Excuse me for the noob question, but is there a way to compare a field
in mysql as lower() somehow?

I have a situation where I compare the SKU in my DB and there are some
SKU that are with lowercase and some with uppercase, how can I solve
this in your opinion ?

def Update_SQL(price, sku):

    db = MySQLdb.connect("localhost","getit","opencart",
use_unicode=True, charset="utf8")
    cursor = db.cursor()
    sql = "UPDATE product SET price=%s WHERE sku=%s"
    cursor.execute(sql, (price, sku))
    db.commit()
    db.close()


Thanks

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

MySQLdb compare lower Anatoli Hristov <tolidtm@gmail.com> - 2012-12-11 22:01 +0100
  Re: MySQLdb compare lower John Gordon <gordon@panix.com> - 2012-12-11 22:15 +0000
    Re: MySQLdb compare lower Anatoli Hristov <tolidtm@gmail.com> - 2012-12-11 23:39 +0100

csiph-web