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


Groups > comp.lang.python > #60281

Re: JSON translated into SQL by python

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 <rosuav@gmail.com>
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 <c2e7af6f-0757-4243-9535-eb7bcb59a38f@googlegroups.com>
References <c2e7af6f-0757-4243-9535-eb7bcb59a38f@googlegroups.com>
Date Sat, 23 Nov 2013 18:35:39 +1100
Subject Re: JSON translated into SQL by python
From Chris Angelico <rosuav@gmail.com>
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 <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.3074.1385192143.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Sat, Nov 23, 2013 at 4:54 PM, Aaron G.
<another.human.factor@gmail.com> 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

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


Thread

JSON translated into SQL by python "Aaron G." <another.human.factor@gmail.com> - 2013-11-22 21:54 -0800
  Re: JSON translated into SQL by python Chris Angelico <rosuav@gmail.com> - 2013-11-23 18:35 +1100
  Re: JSON translated into SQL by python Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-11-23 10:06 +0200
  Re: JSON translated into SQL by python Peter Otten <__peter__@web.de> - 2013-11-23 09:52 +0100

csiph-web