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


Groups > comp.lang.python > #68336

Re: DB API question - where is a stored procedure's return value?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <random832@fastmail.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'retrieved': 0.05; 'duplicate': 0.07; 'result,': 0.07; 'back-end': 0.09; 'received:internal': 0.09; 'rows,': 0.09; 'variable,': 0.09; 'subject:question': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; '"from': 0.16; '"in': 0.16; 'fetch': 0.16; 'foo()': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'notation': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'removed,': 0.16; 'subject:API': 0.16; 'subject:where': 0.16; 'which,': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'thu,': 0.19; 'select': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; '13,': 0.31; 'such.': 0.31; 'fri,': 0.33; 'received:66': 0.35; 'but': 0.35; '14,': 0.36; 'oracle': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'should': 0.36; 'two': 0.37; 'received:10': 0.37; 'extremely': 0.39; 'how': 0.40; 'most': 0.60; 'from:no real name:2**0': 0.61; 'john': 0.61; 'header:Message- Id:1': 0.63; 'name': 0.63; 'to:addr:gmail.com': 0.65; 'mar': 0.68; 'results': 0.69; '2014,': 0.84; 'from.': 0.93
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= message-id:from:to:cc:mime-version:content-transfer-encoding :content-type:in-reply-to:references:subject:date; s=mesmtp; bh= BaGVEmVxiEqbQogv3DjSU/nVIjw=; b=if4TITMdo89V2dv61CJhpiZbPLm9wj4I 3Ou6yHMj10R69mElAW6OZTw/KY8vUpMfsOm8U66NJhHqaRjvDcLon6rDN8C2+nvY qZ0z3/ym8wrrdSi2VdKcKpUXJnAXDVA1h3MJzB9lw/TtlDgTZQCM/Ko8IVlDZ1YU mAESIwEudEk=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:cc:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=smtpout; bh=BaGVEmVxiEqbQogv3DjSU/nVIjw=; b=bcZ 5944IqpBvIaMGsGzOA7r16yIPvVvf/xhGHeutxiV9OtgGTpZFNlz/TRBuh+QTiTp gv03WpKl0A+JxghoTIE7a1lcOhygaCviP5V7mPgHiG/9dB86i3MRoT0y1mzPFUGI iq+E42rgIZ0uZU4DMwIbqTpkK/faJRdlmzKlC08k=
X-Sasl-Enc ApZiaZ2SIxlnMtpbQ4FNdWPnrKgPYxDfSO2BbmsesZJ0 1394731328
From random832@fastmail.us
To Chris Angelico <rosuav@gmail.com>
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Content-Type text/plain
X-Mailer MessagingEngine.com Webmail Interface - ajax-88721676
In-Reply-To <CAPTjJmqRgUGp=X5O_1pnJhK0=raZj7ALUg0DVsfhuCc0AcexuA@mail.gmail.com>
References <CANc-5Uz98mTCjUuk_yOHqWeZRwp6JnTCagTQ=bzobhtWAceKxg@mail.gmail.com> <CALwzidm0GJ37JTjUUGPPgEXnZoh0ck08B7i2H4SZXXD1VyDcbA@mail.gmail.com> <mailman.8114.1394666303.18130.python-list@python.org> <lfsg5p$e1a$1@reader1.panix.com> <CAPTjJmqRgUGp=X5O_1pnJhK0=raZj7ALUg0DVsfhuCc0AcexuA@mail.gmail.com>
Subject Re: DB API question - where is a stored procedure's return value?
Date Thu, 13 Mar 2014 13:22:08 -0400
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 <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.8130.1394731331.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1394731331 news.xs4all.nl 2879 [2001:888:2000:d::a6]:60088
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:68336

Show key headers only | View raw


On Thu, Mar 13, 2014, at 13:01, Chris Angelico wrote:
> On Fri, Mar 14, 2014 at 1:43 AM, John Gordon <gordon@panix.com> wrote:
> >> select foo() as value from dual
> >
> > That will get the return value into an SQL variable, but the OP wanted
> > to know how to fetch it from python code.
> 
> In theory, that should produce a one-row-one-column SELECT result,
> which can then be retrieved as such. (I say "in theory" because not
> all back-end databases support the "from dual" notation - which, by
> the way, I find extremely odd; what's 'dual' about it?)

DUAL is an Oracle thing. It used to have two rows, in order to be used
to duplicate results by doing a cartesian join to it. At some point,
that was removed, but the name stuck.

Most other servers allow SELECT without FROM.

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


Thread

Re: DB API question - where is a stored procedure's return value? Petite Abeille <petite.abeille@gmail.com> - 2014-03-13 00:11 +0100
  Re: DB API question - where is a stored procedure's return value? John Gordon <gordon@panix.com> - 2014-03-13 14:43 +0000
    Re: DB API question - where is a stored procedure's return value? Skip Montanaro <skip@pobox.com> - 2014-03-13 10:14 -0500
    Re: DB API question - where is a stored procedure's return value? Chris Angelico <rosuav@gmail.com> - 2014-03-14 04:01 +1100
    Re: DB API question - where is a stored procedure's return value? random832@fastmail.us - 2014-03-13 13:22 -0400
    Re: DB API question - where is a stored procedure's return value? Chris Angelico <rosuav@gmail.com> - 2014-03-14 04:32 +1100

csiph-web