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


Groups > comp.lang.python > #60281

Re: JSON translated into SQL by python

References <c2e7af6f-0757-4243-9535-eb7bcb59a38f@googlegroups.com>
Date 2013-11-23 18:35 +1100
Subject Re: JSON translated into SQL by python
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3074.1385192143.18130.python-list@python.org> (permalink)

Show all headers | 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