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?

From random832@fastmail.us
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 2014-03-13 13:22 -0400
Newsgroups comp.lang.python
Message-ID <mailman.8130.1394731331.18130.python-list@python.org> (permalink)

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