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


Groups > comp.lang.python > #68305 > unrolled thread

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

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2014-03-12 17:00 -0600
Last post2014-03-12 17:00 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: DB API question - where is a stored procedure's return value? Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-12 17:00 -0600

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

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-03-12 17:00 -0600
SubjectRe: DB API question - where is a stored procedure's return value?
Message-ID<mailman.8110.1394665261.18130.python-list@python.org>
On Wed, Mar 12, 2014 at 3:44 PM, Skip Montanaro <skip@pobox.com> wrote:
> What do other database adaptors do about stored procedure return
> values? Does PEP 249 need revision?

I can't speak generally, but in cx_Oracle you either execute a query like this:

    result = cursor.var(cx_Oracle.NUMBER)
    cursor.execute(":1 := test_proc()", [result])
    print(result.getvalue())

or you use the non-standard callfunc method:

    print(cursor.callfunc("test_proc", cx_Oracle.NUMBER))

As a general solution, one might wrap a stored procedure that returns
a value into a stored procedure that has an output parameter and call
it with callproc.  Some implementations might include a return value
in the parameter list anyway.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web