[DB-SIG] stored procedures

M.-A. Lemburg mal@lemburg.com
Wed, 03 Feb 1999 22:33:54 +0100


Ted Horst wrote:
> 
> On Wed, 03 Feb 1999, "M.-A. Lemburg" wrote:
> > The result of the call is returned by
> > modifying the list contents in place.
> 
> The python CORBA spec leaves the inputs alone, and returns a tuple of the
> out, inout parameters.  Don't know that I have a preference one way or the
> other, but it might be a good idea to be consistent.

The reason for modifying the parameter list in place was simply
that some database interface modules might not be able to
determine whether a parameter is IN, INOUT or OUT. In that case, the
parameter would be left untouched and the application could check
the results for validity.

An alternative would be returning the result as tuple by copying
all input parameters to it as well. The input list would then
be left untouched...

output = cursor.callproc(procname,input)

with list(output) == list(input) for procedures with only
input parameters.

This approach might be more Pythonesque since it does not manipulate
things in place. Dunno ... I think I'll have to implement this
first to see where the difficulties are (does anybody have experience
with this ?).

-- 
Marc-Andre Lemburg                               Y2000: 331 days left
---------------------------------------------------------------------
          : Python Pages >>> http://starship.skyport.net/~lemburg/  :
           ---------------------------------------------------------