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


Groups > comp.lang.python > #64560

Re: problem with sqlite3: cannot use < in a SQL query with (?)

Path csiph.com!usenet.pasdenom.info!gegeweb.org!newsfeed0.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <bgailer@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.094
X-Spam-Evidence '*H*': 0.81; '*S*': 0.00; 'subject:query': 0.07; 'rows': 0.09; 'stored': 0.12; 'filename,': 0.16; 'select,': 0.16; 'subject:sqlite3': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'module': 0.19; 'help.': 0.21; 'select': 0.22; 'header:User- Agent:1': 0.23; 'subject:problem': 0.24; 'header:In-Reply-To:1': 0.27; 'to:2**1': 0.27; "doesn't": 0.30; "i'm": 0.30; 'code': 0.31; 'update.': 0.31; 'there.': 0.32; 'figure': 0.32; 'open': 0.33; 'maybe': 0.34; 'subject:with': 0.35; "can't": 0.35; 'operations': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'building': 0.35; 'similar': 0.36; 'should': 0.36; 'application': 0.37; 'message- id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'course': 0.61; 'simple': 0.61; 'show': 0.63; 'field': 0.63; 'regards.': 0.65; 'exceed': 0.68; 'user,': 0.69; 'subject:SQL': 0.84; 'do:': 0.91; 'to:addr:hotmail.com': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=ZCJIvX7cBVusfZDfWexLJiLQggJp+HXtACn9RcsmSa4=; b=vFWPtms0ic/c6Xc8IxehelgihVX+1wCeWnRgYz/g6ie8zPgDaL3SBxCkDNpmEJA7Ji pvyqmcf/y5YOEWswqNYamvZ4eFzj/HUE+tNBxrjFLzF80rVMRRmyL/FMPNmvwWYy0jTz DpUcJ1V8HiITmpy0OLPGgUrLM1Z5x1tYlVrbhuJN6EFli8GEKQ5AAraSUDgJOQHfF101 5uxkGIDwiWRW8OgaK3SvtqOPclzrETJJXVpExlxW1x5ldRS5DeTU7MtaWrQLT59ZudRm 6pZV9OZuqVn+Eq3LvXLe5T/m2tLDh8DCcUaXq5dVxc7NYjH99sC/1lgZrvV9s4KdoxPV Ajcw==
X-Received by 10.224.66.134 with SMTP id n6mr7788942qai.39.1390445517440; Wed, 22 Jan 2014 18:51:57 -0800 (PST)
Date Wed, 22 Jan 2014 21:51:56 -0500
From bob gailer <bgailer@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version 1.0
To lgabiot <lgabiot@hotmail.com>, python-list@python.org
Subject Re: problem with sqlite3: cannot use < in a SQL query with (?)
References <52e07f45$0$3631$426a34cc@news.free.fr>
In-Reply-To <52e07f45$0$3631$426a34cc@news.free.fr>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
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.5863.1390445524.18130.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1390445524 news.xs4all.nl 2849 [2001:888:2000:d::a6]:35118
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64560

Show key headers only | View raw


On 1/22/2014 9:32 PM, lgabiot wrote:
> Hello,
>
> I'm building an application using a simple sqlite3 database.
> At some point, I need to select rows (more precisely some fields in 
> rows) that have the following property: their field max_level (an INT),
> should not exceed a value stored in a variable called threshold, where 
> an int is stored (value 20000).
> (threshold needs to be set by the user, so I cannot hard code a value 
> there).
>
> My database already exist on my drive (and of course the sqlite3 
> module is imported)
>
> I do the following:
>
> >>>conn = sqlite3.connect(mydb) # open the database
> that's OK
>
> >>>cursor = conn.execute("SELECT filename, filepath  FROM files WHERE 
> max_level<(?)", threshold)
> that doesn't work (throw an exception)
>
> if I do:
> >>>cursor = conn.execute("SELECT filename, filepath  FROM files WHERE 
> max_level<20000)")
> it works...
>
> I did similar operations on UPDATE instead of SELECT, and it works there.
SO SHOW US THE UPDATE. "Similar" does not help.
> Maybe my mind is fried right now, but I can't figure out the solution...
>
> best regards.

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