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


Groups > comp.lang.python > #68335

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'retrieved': 0.05; 'result,': 0.07; 'back-end': 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; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'notation': 0.16; 'subject:API': 0.16; 'subject:where': 0.16; 'which,': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'select': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'such.': 0.31; 'fri,': 0.33; 'but': 0.35; 'received:google.com': 0.35; '14,': 0.36; 'subject:?': 0.36; 'should': 0.36; 'extremely': 0.39; 'how': 0.40; 'john': 0.61; 'mar': 0.68; 'to:none': 0.92
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:cc :content-type; bh=FEwjJrHNu/zrIJ1iORG/jnVhSwcN8ufVarCqkKiebbQ=; b=AiSBCAas+aNFc//QXrAo27iyfx/PfuIl3LlGd31Qc+dKvjJTYM+OKSgqRPABhCFP3X S2qxBRp8zJ9eX6eetll0r6XIZwqDx7Faorn+awhxO9sQKRP0YMpOVBV5u1xpSfXsBIer a3uF3JJBdt0/5fLkTzQdg0Rfw6S9H8I9iHZM6MQ/KSFVhoKra+HnPQQ6D/97zAyEhf3D fTGRmJ16y76z+3y6dNZidZEwY62tyz+fbiheK8qwH5Dd27tcnbQ6w/h1gYErOHh3wNie 4mOEku/m7cWrDRrxsorZGM+rTPWGGGiBsh9BoXmtXlCn2L86jBh9hJyc2c4mrTCKpqu2 TlXw==
MIME-Version 1.0
X-Received by 10.66.102.39 with SMTP id fl7mr3534474pab.43.1394730063011; Thu, 13 Mar 2014 10:01:03 -0700 (PDT)
In-Reply-To <lfsg5p$e1a$1@reader1.panix.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>
Date Fri, 14 Mar 2014 04:01:02 +1100
Subject Re: DB API question - where is a stored procedure's return value?
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.8129.1394730071.18130.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1394730072 news.xs4all.nl 2833 [2001:888:2000:d::a6]:55139
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:68335

Show key headers only | View raw


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?)

ChrisA

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