Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.031 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'subject:into': 0.09; '"insert': 0.16; '23,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'query,': 0.16; 'subject:python': 0.16; 'sat,': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'query': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'table': 0.34; 'received:google.com': 0.35; 'really': 0.36; 'should': 0.36; 'nov': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'most': 0.60; 'subject:SQL': 0.84; '2013': 0.98 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:to :content-type; bh=N+ZdT6sxmkPGh69aL1cRF7LX2Tu8mCeWqsN4nto+yjI=; b=ojLg1FO07yyxOpN4bOqUz2xLdlkPmbj5bwRyacyMi1AWZrJ5yFGE3evgUl+qZNn02K fxxUUUtaSPF+zrZvVN5BFKnWrvyMY5Te2YM70vqltRT/ztTRvRb6D409xOOcLE15Ft/m UMqFJNLKPjPhpYvq6h95tL1bQMGxYMrKhJTYdqEYCESs4MdzJfX8pR4fOfJIWSBLNsI9 nws4IgQfQXNMxqi02s49JLzDrNWtvdmjiRxyRFSavAr9Dt0UlImGli9+Yuy6yQJuOptR ngE3o4zfIRhQz8CNhvBmmlv1dMsGGiXtzwxzwoNW+nuSQ6TMsZ9z0KIxKS79Tez6aHld 857Q== MIME-Version: 1.0 X-Received: by 10.66.26.106 with SMTP id k10mr306041pag.136.1385192140004; Fri, 22 Nov 2013 23:35:40 -0800 (PST) In-Reply-To: References: Date: Sat, 23 Nov 2013 18:35:39 +1100 Subject: Re: JSON translated into SQL by python From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1385192143 news.xs4all.nl 15870 [2001:888:2000:d::a6]:45790 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60281 On Sat, Nov 23, 2013 at 4:54 PM, Aaron G. wrote: > query = "INSERT INTO TABLE temp2 (enterprise) VALUES("+ str(curObservation) +");" You just put the contents of curObservation into the query, as SQL code. Is that really what you wanted to do? Most likely, you should be using a parameterized query here; are you familiar with that concept? You seem to have custom functions to do your database work here. Without knowing what those functions do, it's hard for us to advise further. ChrisA