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


Groups > comp.lang.python > #64569

Re: sqlite3 docbug (was problem with sqlite3)

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'builtin': 0.09; 'cursor': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; '23,': 0.16; 'filename,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:sqlite3': 0.16; 'tuple': 0.16; 'tuple,': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'thu,': 0.19; 'example': 0.22; 'cc:addr:python.org': 0.22; 'faq': 0.24; 'subject:problem': 0.24; 'fairly': 0.24; 'fine': 0.24; 'helpful': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'tracker': 0.26; 'second': 0.26; 'header:In- Reply-To:1': 0.27; 'tim': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'becoming': 0.31; 'chase': 0.31; 'url:python': 0.33; 'could': 0.34; 'subject: (': 0.35; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'should': 0.36; 'january': 0.37; 'clear': 0.37; 'url:library': 0.38; 'files': 0.38; 'issue': 0.38; 'pm,': 0.38; 'that,': 0.38; 'sure': 0.39; 'either': 0.39; 'even': 0.60; 'more': 0.64; 'attention': 0.75; 'dict.': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=H3olVZLHzH73M2KUsAT32JMLdImIxAdpeYXCq6N2AAk=; b=ehUs2aTaWXX41QqNO8hiVYqJRFveo+908NlI3Jp7CtSCEqaGp+E3pS/0/okbnoAaHd h0jQ8bmQTfeHxmiYC3PdjL51888znvqAoya5YtcZK9Cdqajd5K1v3d0p40bLSiF0Y4Vw a7zYCvi8eU9Upkdmo+fzHCHvtX5Kz2525MiR22Im1CULsL0BR6ro1XB09FdN1zHzcqnq 6eyKy9Q+7sazRLISGB56GnUjjhHZ2CXIrMDdkHvLNXUegTKx3S4MAz5GbXy2ynJPKlUk SLC9DTTZ8UPzU7DkeSdgGs/Dxxuz8YmL55CGFa1qQjiwjYndftL4iBzt0nH0sDjiMbPM BwyQ==
MIME-Version 1.0
X-Received by 10.66.164.229 with SMTP id yt5mr5890175pab.67.1390452102684; Wed, 22 Jan 2014 20:41:42 -0800 (PST)
In-Reply-To <d8243c7c-8d9c-4ef6-8842-2fe856633a4e@googlegroups.com>
References <52e07f45$0$3631$426a34cc@news.free.fr> <mailman.5864.1390446316.18130.python-list@python.org> <d8243c7c-8d9c-4ef6-8842-2fe856633a4e@googlegroups.com>
Date Thu, 23 Jan 2014 15:41:42 +1100
Subject Re: sqlite3 docbug (was problem with sqlite3)
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5870.1390452106.18130.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1390452106 news.xs4all.nl 2840 [2001:888:2000:d::a6]:40863
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64569

Show key headers only | View raw


On Thu, Jan 23, 2014 at 3:33 PM, Rustom Mody <rustompmody@gmail.com> wrote:
> On Thursday, January 23, 2014 8:35:58 AM UTC+5:30, Tim Chase wrote:
>> On 2014-01-23 03:32, lgabiot wrote:
>> >  >>>cursor = conn.execute("SELECT filename, filepath  FROM files
>> >  >>>WHERE
>> > max_level<(?)", threshold)
>> > that doesn't work (throw an exception)
>
>> That last argument should be a tuple, so unless "threshold"
>>  is a tuple, you would want to make it
>
>>   sql = "SELECT ... WHERE max_level < ?"
>>   cursor = conn.execute(sql, (threshold,))
>
> Seeing this is becoming a faq I looked at the docs to see if the tuple second
> argument could do with some more emphasis
>
> I think it sure could; see
> http://docs.python.org/2/library/sqlite3.html#sqlite3.Cursor
>
> The builtin connection.execute is even less helpful

I think it's fairly clear from the example that it has to be either a
tuple or a dict. Looks fine to me. But I'm sure that, if you come up
with better wording, a tracker issue would get the attention it
deserves.

ChrisA

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


Thread

problem with sqlite3: cannot use < in a SQL query with (?) lgabiot <lgabiot@hotmail.com> - 2014-01-23 03:32 +0100
  Re: problem with sqlite3: cannot use < in a SQL query with (?) lgabiot <lgabiot@hotmail.com> - 2014-01-23 03:34 +0100
  Re: problem with sqlite3: cannot use < in a SQL query with (?) Chris Angelico <rosuav@gmail.com> - 2014-01-23 13:42 +1100
  Re: problem with sqlite3: cannot use < in a SQL query with (?) bob gailer <bgailer@gmail.com> - 2014-01-22 21:51 -0500
  Re: problem with sqlite3: cannot use < in a SQL query with (?) bob gailer <bgailer@gmail.com> - 2014-01-22 21:51 -0500
  Re: problem with sqlite3: cannot use < in a SQL query with (?) Tim Chase <python.list@tim.thechases.com> - 2014-01-22 21:05 -0600
    sqlite3 docbug (was problem with sqlite3) Rustom Mody <rustompmody@gmail.com> - 2014-01-22 20:33 -0800
      Re: sqlite3 docbug (was problem with sqlite3) Rustom Mody <rustompmody@gmail.com> - 2014-01-22 20:37 -0800
      Re: sqlite3 docbug (was problem with sqlite3) Chris Angelico <rosuav@gmail.com> - 2014-01-23 15:41 +1100
        Re: sqlite3 docbug (was problem with sqlite3) Rustom Mody <rustompmody@gmail.com> - 2014-01-22 21:35 -0800
          Re: sqlite3 docbug (was problem with sqlite3) Chris Angelico <rosuav@gmail.com> - 2014-01-23 16:42 +1100
            Re: sqlite3 docbug (was problem with sqlite3) lgabiot <lgabiot@hotmail.com> - 2014-01-23 08:37 +0100
              Re: sqlite3 docbug (was problem with sqlite3) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-23 09:04 +0000
                Re: sqlite3 docbug (was problem with sqlite3) lgabiot <lgabiot@hotmail.com> - 2014-01-23 10:45 +0100
                Re: sqlite3 docbug (was problem with sqlite3) Rustom Mody <rustompmody@gmail.com> - 2014-01-23 02:23 -0800
                Re: sqlite3 docbug (was problem with sqlite3) lgabiot <laurent.gabiot@gmail.com> - 2014-01-23 10:45 +0100
            Re: sqlite3 docbug (was problem with sqlite3) lgabiot <laurent.gabiot@gmail.com> - 2014-01-23 08:37 +0100
          Re: sqlite3 docbug (was problem with sqlite3) Terry Reedy <tjreedy@udel.edu> - 2014-01-23 05:43 -0500
            Re: sqlite3 docbug (was problem with sqlite3) Rustom Mody <rustompmody@gmail.com> - 2014-01-23 07:00 -0800
          Re: sqlite3 docbug (was problem with sqlite3) Tim Chase <python.list@tim.thechases.com> - 2014-01-23 06:36 -0600
          Re: sqlite3 docbug (was problem with sqlite3) Terry Reedy <tjreedy@udel.edu> - 2014-01-23 20:03 -0500
        Re: sqlite3 docbug (was problem with sqlite3) Asaf Las <roegltd@gmail.com> - 2014-01-22 23:18 -0800
          Re: sqlite3 docbug (was problem with sqlite3) Chris Angelico <rosuav@gmail.com> - 2014-01-23 18:47 +1100

csiph-web