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: 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 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-88721676 In-Reply-To: References: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Thu, Mar 13, 2014, at 13:01, Chris Angelico wrote: > 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?) 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.