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: 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: References: 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 Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Fri, Mar 14, 2014 at 1:43 AM, John Gordon 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