Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'subject:query': 0.07; 'cursor': 0.09; 'cc:addr:python-list': 0.11; '-tkc': 0.16; 'filename,': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'subject:sqlite3': 0.16; 'tuple,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'subject:problem': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'subject:with': 0.35; 'charset:us-ascii': 0.36; 'should': 0.36; 'files': 0.38; 'received:50.22': 0.84; 'subject:SQL': 0.84; 'to:addr:hotmail.com': 0.98 Date: Wed, 22 Jan 2014 21:05:58 -0600 From: Tim Chase To: lgabiot Subject: Re: problem with sqlite3: cannot use < in a SQL query with (?) In-Reply-To: <52e07f45$0$3631$426a34cc@news.free.fr> References: <52e07f45$0$3631$426a34cc@news.free.fr> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-1.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1390446316 news.xs4all.nl 2902 [2001:888:2000:d::a6]:40648 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64561 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,)) -tkc